<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">




<title>Castle ActiveRecord学习实践（4）：实现One-Many关系的映射 - TerryLee's Tech Space - 博客园</title>
<meta name="keywords" content="11,数据持久,12,开源世界,Castle,ActiveRecord学习实践,实现One,Many关系的映射">
<meta name="description" content="前面几篇文章简单的介绍了ActiveRecord中的基本映射以及构建配置信息，本文我们用ActiveRecord里面的Blog，Post例子来实现One-Many/Many-One关联。主要内容1．准备数据表结构2．编写实体类并介绍HasMany和BlongsTo特性3．构建配置信息4．编写测试代码">




<link title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/Terrylee/rss">
<link title="RSD" type="application/rsd+xml" rel="EditURI" href="http://www.cnblogs.com/Terrylee/rsd.xml"> 
  



<link rel="stylesheet" type="text/css" href="index.css" media="all">
</head>
<body>
    <form name="Form1" method="post" action="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html" id="Form1">
<div>
<input name="__EVENTTARGET" id="__EVENTTARGET" value="" type="hidden">
<input name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" type="hidden">
<input name="__VIEWSTATE" id="__VIEWSTATE" value="" type="hidden">
</div>




        <link rel="shortcut icon" href="blogengine.ico">
<!--done-->
<div id="home">
<div id="header">
	<div id="blogTitle">
	<a id="lnkBlogLogo" href="http://www.cnblogs.com/Terrylee/"><img id="blogLogo" src="logo.gif" alt="返回主页"></a>			
		
<!--done-->
<h1><a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/Terrylee/">TerryLee's Tech Space</a></h1>
<h2>TerryLee技术专栏</h2>



		
	</div><!--end: blogTitle 博客的标题和副标题 -->
	<div id="navigator">
		
<!--done-->
			<ul id="navList">
				<li><a id="MyLinks1_HomeLink" class="menu" href="http://www.cnblogs.com/">博客园</a></li>
				<li><a id="MyLinks1_SpaceLink" class="menu" href="http://space.cnblogs.com/">社区</a></li>
				<li><a id="MyLinks1_MyHomeLink" class="menu" href="http://www.cnblogs.com/Terrylee/">首页</a></li>
				<li><a id="MyLinks1_NewPostLink" class="menu" href="http://www.cnblogs.com/Terrylee/admin/EditPosts.aspx?opt=1">新随笔</a></li>
				<li><a id="MyLinks1_ContactLink" accesskey="9" class="menu" href="http://space.cnblogs.com/msg/send/TerryLee">联系</a></li>
				<li><a id="MyLinks1_Admin" class="menu" href="http://www.cnblogs.com/Terrylee/admin/EditPosts.aspx">管理</a></li>
				<li><a id="MyLinks1_Syndication" class="menu" href="http://www.cnblogs.com/Terrylee/rss">订阅</a>
				<a id="MyLinks1_XMLLink" class="aHeaderXML" href="http://www.cnblogs.com/Terrylee/rss"><img src="rss.gif" alt="订阅" style="border-width: 0px;"></a></li>
			</ul>


		<div class="blogStats">
			
			
<!--done-->
随笔- 491&nbsp;
文章- 3&nbsp;
评论- 15367&nbsp;

			
		</div><!--end: blogStats -->
	</div><!--end: navigator 博客导航栏 -->
</div><!--end: header 头部 -->

<div id="main">
	<div id="mainContent">
	<div class="forFlow">
		
					
<!--done-->
<div id="topics">
	<div class="post">
		<h1 class="postTitle">
			<a id="ctl04_TitleUrl" class="postTitle2" href="http://www.cnblogs.com/Terrylee/archive/2006/04/06/368471.html">Castle ActiveRecord学习实践（4）：实现One-Many关系的映射</a>
		</h1>
		<div class="clear"></div>
		<div class="postBody">
			<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">摘要：前面几篇文章简单的介绍了<span lang="EN-US">ActiveRecord</span>中的基本映射以及构建配置信息，本文我们用<span lang="EN-US">ActiveRecord</span>里面的<span lang="EN-US">Blog</span>，<span lang="EN-US">Post</span>例子来实现<span lang="EN-US">One-Many/Many-One</span>关联。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><b style=""><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">主要内容<span lang="EN-US"><o:p></o:p></span></span></b></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">1</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">．准备数据表结构<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">2</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">．编写实体类并介绍<span lang="EN-US">HasMany</span>和<span lang="EN-US">BlongsTo</span>特性<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">3</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">．构建配置信息<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">4</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">．编写测试代码<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><b style=""><span style="font-size: 10pt; color: rgb(0, 102, 153); line-height: 200%; font-family: 宋体;">一．准备数据表结构<span lang="EN-US"><o:p></o:p></span></span></b></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">在这个例子中，我们引入了两个对象<span lang="EN-US">Blog</span>、<span lang="EN-US">Post</span>，它们之间的关系是一对多，即一个<span lang="EN-US">Blog</span>有多篇<span lang="EN-US">Post</span>。需要用到的数据表结构如下<br></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 0, 255);">CREATE</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">TABLE</span><span style="color: rgb(0, 0, 0);">&nbsp;Blogs&nbsp;(<br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;blog_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-weight: bold; color: rgb(0, 0, 0);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 255);">IDENTITY</span><span style="color: rgb(0, 0, 0);">(</span><span style="font-weight: bold; color: rgb(128, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="font-weight: bold; color: rgb(128, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">)&nbsp;</span><span style="color: rgb(0, 0, 255);">PRIMARY</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">KEY</span><span style="color: rgb(0, 0, 0);">,<br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;blog_name&nbsp;&nbsp;&nbsp;</span><span style="font-weight: bold; color: rgb(0, 0, 0);">varchar</span><span style="color: rgb(0, 0, 0);">(</span><span style="font-weight: bold; color: rgb(128, 0, 0);">50</span><span style="color: rgb(0, 0, 0);">),<br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;blog_author&nbsp;</span><span style="font-weight: bold; color: rgb(0, 0, 0);">varchar</span><span style="color: rgb(0, 0, 0);">(</span><span style="font-weight: bold; color: rgb(128, 0, 0);">50</span><span style="color: rgb(0, 0, 0);">)<br><img src="none.gif" align="top"><br><img src="none.gif" align="top">)<br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">CREATE</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">TABLE</span><span style="color: rgb(0, 0, 0);">&nbsp;Posts&nbsp;(<br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;post_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-weight: bold; color: rgb(0, 0, 0);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(255, 0, 255);">IDENTITY</span><span style="color: rgb(0, 0, 0);">(</span><span style="font-weight: bold; color: rgb(128, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="font-weight: bold; color: rgb(128, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">)&nbsp;</span><span style="color: rgb(0, 0, 255);">PRIMARY</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">KEY</span><span style="color: rgb(0, 0, 0);">,<br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;post_title&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-weight: bold; color: rgb(0, 0, 0);">varchar</span><span style="color: rgb(0, 0, 0);">(</span><span style="font-weight: bold; color: rgb(128, 0, 0);">50</span><span style="color: rgb(0, 0, 0);">),<br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;post_contents&nbsp;&nbsp;</span><span style="font-weight: bold; color: rgb(0, 0, 0);">text</span><span style="color: rgb(0, 0, 0);">,<br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;post_categories&nbsp;</span><span style="font-weight: bold; color: rgb(0, 0, 0);">varchar</span><span style="color: rgb(0, 0, 0);">(</span><span style="font-weight: bold; color: rgb(128, 0, 0);">50</span><span style="color: rgb(0, 0, 0);">),<br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;post_blogid&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-weight: bold; color: rgb(0, 0, 0);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">FOREIGN</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">KEY</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">REFERENCES</span><span style="color: rgb(0, 0, 0);">&nbsp;Blogs&nbsp;(blog_id),<br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;post_created&nbsp;&nbsp;&nbsp;</span><span style="font-weight: bold; color: rgb(0, 0, 0);">datetime</span><span style="color: rgb(0, 0, 0);">,<br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;post_published&nbsp;</span><span style="font-weight: bold; color: rgb(0, 0, 0);">bit</span><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top"><br><img src="none.gif" align="top">)</span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><br><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: left;" align="left"><b style=""><span style="font-size: 10pt; color: rgb(0, 102, 153); line-height: 200%; font-family: 宋体;">二．编写实体类<span lang="EN-US"><o:p></o:p></span></span></b></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;">
</p><p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">首先我们来看<span lang="EN-US">Blog</span>实体类的编写，需要用到<span lang="EN-US">HasMany</span>特性，这时我们会在<span lang="EN-US">Blog</span>实体类中定义一个<span lang="EN-US">Posts</span>属性，用它来表示该<span lang="EN-US">Blog</span>所发表的所有<span lang="EN-US">Posts</span>，代码如下<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"></span></p>
<p>&nbsp;</p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">[ActiveRecord(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Blogs</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog&nbsp;:&nbsp;ActiveRecordBase<br><img src="none.gif" align="top"><br><img id="Codehighlighter1_63_278_Open_Image" onclick="this.style.display='none'; Codehighlighter1_63_278_Open_Text.style.display='none'; Codehighlighter1_63_278_Closed_Image.style.display='inline'; Codehighlighter1_63_278_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_63_278_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_63_278_Closed_Text.style.display='none'; Codehighlighter1_63_278_Open_Image.style.display='inline'; Codehighlighter1_63_278_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_63_278_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_63_278_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">……</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;IList&nbsp;_posts;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[HasMany(</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(Post),&nbsp;Table</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">posts</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;ColumnKey</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">post_blogid</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;IList&nbsp;Posts<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_203_275_Open_Image" onclick="this.style.display='none'; Codehighlighter1_203_275_Open_Text.style.display='none'; Codehighlighter1_203_275_Closed_Image.style.display='inline'; Codehighlighter1_203_275_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_203_275_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_203_275_Closed_Text.style.display='none'; Codehighlighter1_203_275_Open_Image.style.display='inline'; Codehighlighter1_203_275_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_203_275_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_203_275_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_218_235_Open_Image" onclick="this.style.display='none'; Codehighlighter1_218_235_Open_Text.style.display='none'; Codehighlighter1_218_235_Closed_Image.style.display='inline'; Codehighlighter1_218_235_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_218_235_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_218_235_Closed_Text.style.display='none'; Codehighlighter1_218_235_Open_Image.style.display='inline'; Codehighlighter1_218_235_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_218_235_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_218_235_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_posts;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_250_268_Open_Image" onclick="this.style.display='none'; Codehighlighter1_250_268_Open_Text.style.display='none'; Codehighlighter1_250_268_Closed_Image.style.display='inline'; Codehighlighter1_250_268_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_250_268_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_250_268_Closed_Text.style.display='none'; Codehighlighter1_250_268_Open_Image.style.display='inline'; Codehighlighter1_250_268_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_250_268_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_250_268_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_posts&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top">}</span></span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><br>HasManyAttribute<span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">说明<span lang="EN-US"><o:p></o:p></span></span></p>
<p>
</p><table class="MsoTableGrid" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0">
    <tbody>
        <tr style="">
            <td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: 91.5pt;" valign="top" width="122">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: center;" align="center"><b style=""><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">属性<span lang="EN-US"><o:p></o:p></span></span></b></p>
            </td>
            <td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext rgb(212, 208, 200); border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: 183.9pt;" valign="top" width="245">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: center;" align="center"><b style=""><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">说明<span lang="EN-US"><o:p></o:p></span></span></b></p>
            </td>
            <td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext rgb(212, 208, 200); border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: 150.7pt;" valign="top" width="201">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: center;" align="center"><b style=""><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">示例<span lang="EN-US"><o:p></o:p></span></span></b></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 91.5pt; background-color: transparent;" valign="top" width="122">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Cascade<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 183.9pt; background-color: transparent;" valign="top" width="245">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">指明哪些操作会从父对象级联到关联的对象，相关的操作见后面，如果不指定，则为<span lang="EN-US">None<o:p></o:p></span></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 150.7pt; background-color: transparent;" valign="top" width="201">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Cascade<span style="color: fuchsia;">=</span>ManyRelationCascadeEnum<span style="color: fuchsia;">.</span>All<o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 91.5pt; background-color: transparent;" valign="top" width="122">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Inverse<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 183.9pt; background-color: transparent;" valign="top" width="245">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">指定是否级联操作<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 150.7pt; background-color: transparent;" valign="top" width="201">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Inverse<span style="color: fuchsia;"> =</span><span style="color: blue;">true</span>|<span style="color: blue;">false</span><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 91.5pt; background-color: transparent;" valign="top" width="122">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Schema<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 183.9pt; background-color: transparent;" valign="top" width="245">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">指定<span lang="EN-US">Schema</span>的名字</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 150.7pt; background-color: transparent;" valign="top" width="201">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Schema<span style="color: fuchsia;">=</span><span style="color: maroon;">"ARDemo"</span><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 91.5pt; background-color: transparent;" valign="top" width="122">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Table<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 183.9pt; background-color: transparent;" valign="top" width="245">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">指定持久化类所关联的数据库表名，如果表名与类名相同，可以省略</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 150.7pt; background-color: transparent;" valign="top" width="201">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Table<span style="color: fuchsia;">=</span><span style="color: maroon;">"posts"</span><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 91.5pt; background-color: transparent;" valign="top" width="122">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">ColumnKey<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 183.9pt; background-color: transparent;" valign="top" width="245">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">指定关联类的一个属性，这个属性将会和本外键相对应。<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 150.7pt; background-color: transparent;" valign="top" width="201">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">ColumnKey<span style="color: fuchsia;">=</span><span style="color: maroon;">"post_blogid"</span><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 91.5pt; background-color: transparent;" valign="top" width="122">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Where<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 183.9pt; background-color: transparent;" valign="top" width="245">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">指定一个附加<span lang="EN-US">SQL</span>的<span lang="EN-US">Where</span>子句</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 150.7pt; background-color: transparent;" valign="top" width="201">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Where<span style="color: fuchsia;">=</span><span style="color: maroon;">"IsPost = 0"</span><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 91.5pt; background-color: transparent;" valign="top" width="122">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Lazy<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 183.9pt; background-color: transparent;" valign="top" width="245">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">指定是否延迟加载关联对象</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 150.7pt; background-color: transparent;" valign="top" width="201">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Lazy<span style="color: fuchsia;">=</span><span style="color: blue;">true</span>|<span style="color: blue;">false</span><o:p></o:p></span></p>
            </td>
        </tr>
    </tbody>
</table>
<span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><br>Cascade</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">的类型值有如下几种<span lang="EN-US"><o:p></o:p></span></span>
<p>
</p><table class="MsoTableGrid" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0">
    <tbody>
        <tr style="">
            <td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: 86.4pt;" valign="top" width="115">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: center;" align="center"><b style=""><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">类型<span lang="EN-US"><o:p></o:p></span></span></b></p>
            </td>
            <td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext rgb(212, 208, 200); border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: 339.7pt;" valign="top" width="453">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: center;" align="center"><b style=""><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">说明<span lang="EN-US"><o:p></o:p></span></span></b></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 86.4pt; background-color: transparent;" valign="top" width="115">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">None<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 339.7pt; background-color: transparent;" valign="top" width="453">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">不进行级联操作<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 86.4pt; background-color: transparent;" valign="top" width="115">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">SaveUpdate<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 339.7pt; background-color: transparent;" valign="top" width="453">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">进行级联<span lang="EN-US">Save/Update</span>操作<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 86.4pt; background-color: transparent;" valign="top" width="115">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Delete<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 339.7pt; background-color: transparent;" valign="top" width="453">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">进行级联<span lang="EN-US">Delete</span>操作<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 86.4pt; background-color: transparent;" valign="top" width="115">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">All<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 339.7pt; background-color: transparent;" valign="top" width="453">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">进行级联<span lang="EN-US">Save/Update/Delete</span>操作<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 86.4pt; background-color: transparent;" valign="top" width="115">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">AllDeleteOrphan<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 339.7pt; background-color: transparent;" valign="top" width="453">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">进行级联<span lang="EN-US">Save/Update/Delete</span>操作，并删除无相关父对象的子对象<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
        </tr>
    </tbody>
</table>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">在<span lang="EN-US">Post</span>实体类中，我们需要定义一个<span lang="EN-US">Blog</span>类型的属性，并且用到<span lang="EN-US">BlongsTo</span>特性，即一个<span lang="EN-US">Post</span>属于某一个<span lang="EN-US">Blog</span>，代码如下：<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">[ActiveRecord(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Posts</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;Post&nbsp;:&nbsp;ActiveRecordBase<br><img src="none.gif" align="top"><br><img id="Codehighlighter1_63_230_Open_Image" onclick="this.style.display='none'; Codehighlighter1_63_230_Open_Text.style.display='none'; Codehighlighter1_63_230_Closed_Image.style.display='inline'; Codehighlighter1_63_230_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_63_230_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_63_230_Closed_Text.style.display='none'; Codehighlighter1_63_230_Open_Image.style.display='inline'; Codehighlighter1_63_230_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_63_230_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_63_230_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">……</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog&nbsp;_blog;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[BelongsTo(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">blogid</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog&nbsp;Blog<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_157_227_Open_Image" onclick="this.style.display='none'; Codehighlighter1_157_227_Open_Text.style.display='none'; Codehighlighter1_157_227_Closed_Image.style.display='inline'; Codehighlighter1_157_227_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_157_227_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_157_227_Closed_Text.style.display='none'; Codehighlighter1_157_227_Open_Image.style.display='inline'; Codehighlighter1_157_227_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_157_227_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_157_227_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_172_188_Open_Image" onclick="this.style.display='none'; Codehighlighter1_172_188_Open_Text.style.display='none'; Codehighlighter1_172_188_Closed_Image.style.display='inline'; Codehighlighter1_172_188_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_172_188_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_172_188_Closed_Text.style.display='none'; Codehighlighter1_172_188_Open_Image.style.display='inline'; Codehighlighter1_172_188_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_172_188_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_172_188_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_blog;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_203_220_Open_Image" onclick="this.style.display='none'; Codehighlighter1_203_220_Open_Text.style.display='none'; Codehighlighter1_203_220_Closed_Image.style.display='inline'; Codehighlighter1_203_220_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_203_220_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_203_220_Closed_Text.style.display='none'; Codehighlighter1_203_220_Open_Image.style.display='inline'; Codehighlighter1_203_220_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_203_220_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_203_220_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_blog&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top">}</span></span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><br>BelongsToAttribute<span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">说明<span lang="EN-US"><o:p></o:p></span></span></p>
<p>
</p><table class="MsoTableGrid" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0">
    <tbody>
        <tr style="">
            <td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: 87.05pt;" valign="top" width="116">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: center;" align="center"><b style=""><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">属性<span lang="EN-US"><o:p></o:p></span></span></b></p>
            </td>
            <td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext rgb(212, 208, 200); border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: 197.35pt;" valign="top" width="263">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: center;" align="center"><b style=""><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">说明<span lang="EN-US"><o:p></o:p></span></span></b></p>
            </td>
            <td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext rgb(212, 208, 200); border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: 141.7pt;" valign="top" width="189">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: center;" align="center"><b style=""><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">示例<span lang="EN-US"><o:p></o:p></span></span></b></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 87.05pt; background-color: transparent;" valign="top" width="116">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Cascade<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 197.35pt; background-color: transparent;" valign="top" width="263">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">指定级联操作<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 141.7pt; background-color: transparent;" valign="top" width="189">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Cascade<span style="color: fuchsia;">=</span>CascadeEnum<span style="color: fuchsia;">.</span>SaveUpdate<o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 87.05pt; background-color: transparent;" valign="top" width="116">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Column<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 197.35pt; background-color: transparent;" valign="top" width="263">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">列名，外键字段名<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 141.7pt; background-color: transparent;" valign="top" width="189">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">BelongsTo(<span style="color: maroon;">"blogid"</span>)<o:p></o:p></span></p>
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Column<span style="color: fuchsia;">=</span><span style="color: maroon;">"blogid"</span><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 87.05pt; background-color: transparent;" valign="top" width="116">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Insert<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 197.35pt; background-color: transparent;" valign="top" width="263">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">是否允许增加<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 141.7pt; background-color: transparent;" valign="top" width="189">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Insert<span style="color: fuchsia;">=</span><span style="color: blue;">true</span>|<span style="color: blue;">false</span><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 87.05pt; background-color: transparent;" valign="top" width="116">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">NotNull<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 197.35pt; background-color: transparent;" valign="top" width="263">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">是否允许为空<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 141.7pt; background-color: transparent;" valign="top" width="189">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">NotNull<span style="color: fuchsia;"> =</span><span style="color: blue;">true</span>|<span style="color: blue;">false</span><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 87.05pt; background-color: transparent;" valign="top" width="116">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">OuterJoin<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 197.35pt; background-color: transparent;" valign="top" width="263">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">是否允许外连接抓取<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 141.7pt; background-color: transparent;" valign="top" width="189">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">OuterJoin<span style="color: fuchsia;">=</span>OuterJoinEnum<span style="color: fuchsia;">.</span>True<o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 87.05pt; background-color: transparent;" valign="top" width="116">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Unique<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 197.35pt; background-color: transparent;" valign="top" width="263">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">是否唯一<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 141.7pt; background-color: transparent;" valign="top" width="189">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Unique<span style="color: fuchsia;"> =</span><span style="color: blue;">true</span>|<span style="color: blue;">false</span><o:p></o:p></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 87.05pt; background-color: transparent;" valign="top" width="116">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Update<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 197.35pt; background-color: transparent;" valign="top" width="263">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">是否允许更新<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 141.7pt; background-color: transparent;" valign="top" width="189">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Update<span style="color: fuchsia;"> =</span><span style="color: blue;">true</span>|<span style="color: blue;">false</span><o:p></o:p></span></p>
            </td>
        </tr>
    </tbody>
</table>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Cascade</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">类型如下<span lang="EN-US"><o:p></o:p></span></span></p>
<p>
</p><table class="MsoTableGrid" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0">
    <tbody>
        <tr style="">
            <td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: 140.4pt;" valign="top" width="187">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: center;" align="center"><b style=""><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">选项<span lang="EN-US"><o:p></o:p></span></span></b></p>
            </td>
            <td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext rgb(212, 208, 200); border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: 285.7pt;" valign="top" width="381">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: center;" align="center"><b style=""><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">说明<span lang="EN-US"><o:p></o:p></span></span></b></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 140.4pt; background-color: transparent;" valign="top" width="187">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">None<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 285.7pt; background-color: transparent;" valign="top" width="381">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">默认值，不进行级联操作<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 140.4pt; background-color: transparent;" valign="top" width="187">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">All<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 285.7pt; background-color: transparent;" valign="top" width="381">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">进行级联<span lang="EN-US">Save/Update/Delete</span>操作<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 140.4pt; background-color: transparent;" valign="top" width="187">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">SaveUpdate<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 285.7pt; background-color: transparent;" valign="top" width="381">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">进行级联<span lang="EN-US">Save/Update</span>操作<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
        </tr>
        <tr style="">
            <td style="border-style: none solid solid; border-color: rgb(212, 208, 200) windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 140.4pt; background-color: transparent;" valign="top" width="187">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Delete<o:p></o:p></span></p>
            </td>
            <td style="border-style: none solid solid none; border-color: rgb(212, 208, 200) windowtext windowtext rgb(212, 208, 200); border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 285.7pt; background-color: transparent;" valign="top" width="381">
            <p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">进行级联<span lang="EN-US">Delete</span>操作<span lang="EN-US"><o:p></o:p></span></span></p>
            </td>
        </tr>
    </tbody>
</table>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">OuterJoin</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">选项有三个：<span lang="EN-US">Auto</span>，<span lang="EN-US">True</span>，<span lang="EN-US">False<o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">最后完整的<span lang="EN-US">Blog</span>实体类如下</span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img id="Codehighlighter1_0_46_Open_Image" onclick="this.style.display='none'; Codehighlighter1_0_46_Open_Text.style.display='none'; Codehighlighter1_0_46_Closed_Image.style.display='inline'; Codehighlighter1_0_46_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_0_46_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_0_46_Closed_Text.style.display='none'; Codehighlighter1_0_46_Open_Image.style.display='inline'; Codehighlighter1_0_46_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"><span id="Codehighlighter1_0_46_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);">/**/</span><span id="Codehighlighter1_0_46_Open_Text"><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;summary&gt;</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;Blog&nbsp;的摘要说明。<br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top"></span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;/summary&gt;</span><span style="color: rgb(128, 128, 128);"></span></span><br><img src="none.gif" align="top"><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top">[ActiveRecord(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Blogs</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog&nbsp;:&nbsp;ActiveRecordBase<br><img src="none.gif" align="top"><br><img id="Codehighlighter1_111_1134_Open_Image" onclick="this.style.display='none'; Codehighlighter1_111_1134_Open_Text.style.display='none'; Codehighlighter1_111_1134_Closed_Image.style.display='inline'; Codehighlighter1_111_1134_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_111_1134_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_111_1134_Closed_Text.style.display='none'; Codehighlighter1_111_1134_Open_Image.style.display='inline'; Codehighlighter1_111_1134_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_111_1134_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_111_1134_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;_id;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;_name;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;_author;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;IList&nbsp;_posts;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[PrimaryKey(PrimaryKeyType.Native,&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">blog_id</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;Id<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_306_372_Open_Image" onclick="this.style.display='none'; Codehighlighter1_306_372_Open_Text.style.display='none'; Codehighlighter1_306_372_Closed_Image.style.display='inline'; Codehighlighter1_306_372_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_306_372_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_306_372_Closed_Text.style.display='none'; Codehighlighter1_306_372_Open_Image.style.display='inline'; Codehighlighter1_306_372_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_306_372_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_306_372_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_321_335_Open_Image" onclick="this.style.display='none'; Codehighlighter1_321_335_Open_Text.style.display='none'; Codehighlighter1_321_335_Closed_Image.style.display='inline'; Codehighlighter1_321_335_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_321_335_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_321_335_Closed_Text.style.display='none'; Codehighlighter1_321_335_Open_Image.style.display='inline'; Codehighlighter1_321_335_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_321_335_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_321_335_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_id;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_350_365_Open_Image" onclick="this.style.display='none'; Codehighlighter1_350_365_Open_Text.style.display='none'; Codehighlighter1_350_365_Closed_Image.style.display='inline'; Codehighlighter1_350_365_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_350_365_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_350_365_Closed_Text.style.display='none'; Codehighlighter1_350_365_Open_Image.style.display='inline'; Codehighlighter1_350_365_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_350_365_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_350_365_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_id&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[Property(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">blog_name</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;Name<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_435_505_Open_Image" onclick="this.style.display='none'; Codehighlighter1_435_505_Open_Text.style.display='none'; Codehighlighter1_435_505_Closed_Image.style.display='inline'; Codehighlighter1_435_505_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_435_505_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_435_505_Closed_Text.style.display='none'; Codehighlighter1_435_505_Open_Image.style.display='inline'; Codehighlighter1_435_505_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_435_505_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_435_505_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_450_466_Open_Image" onclick="this.style.display='none'; Codehighlighter1_450_466_Open_Text.style.display='none'; Codehighlighter1_450_466_Closed_Image.style.display='inline'; Codehighlighter1_450_466_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_450_466_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_450_466_Closed_Text.style.display='none'; Codehighlighter1_450_466_Open_Image.style.display='inline'; Codehighlighter1_450_466_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_450_466_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_450_466_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_name;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_481_498_Open_Image" onclick="this.style.display='none'; Codehighlighter1_481_498_Open_Text.style.display='none'; Codehighlighter1_481_498_Closed_Image.style.display='inline'; Codehighlighter1_481_498_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_481_498_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_481_498_Closed_Text.style.display='none'; Codehighlighter1_481_498_Open_Image.style.display='inline'; Codehighlighter1_481_498_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_481_498_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_481_498_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_name&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[Property(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">blog_author</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;Author<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_572_646_Open_Image" onclick="this.style.display='none'; Codehighlighter1_572_646_Open_Text.style.display='none'; Codehighlighter1_572_646_Closed_Image.style.display='inline'; Codehighlighter1_572_646_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_572_646_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_572_646_Closed_Text.style.display='none'; Codehighlighter1_572_646_Open_Image.style.display='inline'; Codehighlighter1_572_646_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_572_646_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_572_646_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_587_605_Open_Image" onclick="this.style.display='none'; Codehighlighter1_587_605_Open_Text.style.display='none'; Codehighlighter1_587_605_Closed_Image.style.display='inline'; Codehighlighter1_587_605_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_587_605_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_587_605_Closed_Text.style.display='none'; Codehighlighter1_587_605_Open_Image.style.display='inline'; Codehighlighter1_587_605_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_587_605_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_587_605_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_author;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_620_639_Open_Image" onclick="this.style.display='none'; Codehighlighter1_620_639_Open_Text.style.display='none'; Codehighlighter1_620_639_Closed_Image.style.display='inline'; Codehighlighter1_620_639_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_620_639_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_620_639_Closed_Text.style.display='none'; Codehighlighter1_620_639_Open_Image.style.display='inline'; Codehighlighter1_620_639_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_620_639_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_620_639_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_author&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[HasMany(</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(Post),&nbsp;Table</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">posts</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;ColumnKey</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">post_blogid</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;IList&nbsp;Posts<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_752_824_Open_Image" onclick="this.style.display='none'; Codehighlighter1_752_824_Open_Text.style.display='none'; Codehighlighter1_752_824_Closed_Image.style.display='inline'; Codehighlighter1_752_824_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_752_824_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_752_824_Closed_Text.style.display='none'; Codehighlighter1_752_824_Open_Image.style.display='inline'; Codehighlighter1_752_824_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_752_824_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_752_824_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_767_784_Open_Image" onclick="this.style.display='none'; Codehighlighter1_767_784_Open_Text.style.display='none'; Codehighlighter1_767_784_Closed_Image.style.display='inline'; Codehighlighter1_767_784_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_767_784_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_767_784_Closed_Text.style.display='none'; Codehighlighter1_767_784_Open_Image.style.display='inline'; Codehighlighter1_767_784_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_767_784_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_767_784_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_posts;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_799_817_Open_Image" onclick="this.style.display='none'; Codehighlighter1_799_817_Open_Text.style.display='none'; Codehighlighter1_799_817_Closed_Image.style.display='inline'; Codehighlighter1_799_817_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_799_817_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_799_817_Closed_Text.style.display='none'; Codehighlighter1_799_817_Open_Image.style.display='inline'; Codehighlighter1_799_817_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_799_817_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_799_817_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_posts&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;DeleteAll()<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_870_913_Open_Image" onclick="this.style.display='none'; Codehighlighter1_870_913_Open_Text.style.display='none'; Codehighlighter1_870_913_Closed_Image.style.display='inline'; Codehighlighter1_870_913_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_870_913_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_870_913_Closed_Text.style.display='none'; Codehighlighter1_870_913_Open_Image.style.display='inline'; Codehighlighter1_870_913_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_870_913_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_870_913_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DeleteAll(&nbsp;</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(Blog)&nbsp;);<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog[]&nbsp;FindAll()<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_959_1016_Open_Image" onclick="this.style.display='none'; Codehighlighter1_959_1016_Open_Text.style.display='none'; Codehighlighter1_959_1016_Closed_Image.style.display='inline'; Codehighlighter1_959_1016_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_959_1016_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_959_1016_Closed_Text.style.display='none'; Codehighlighter1_959_1016_Open_Image.style.display='inline'; Codehighlighter1_959_1016_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_959_1016_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_959_1016_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;(Blog[])&nbsp;FindAll(&nbsp;</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(Blog)&nbsp;);<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog&nbsp;Find(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;id)<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1063_1131_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1063_1131_Open_Text.style.display='none'; Codehighlighter1_1063_1131_Closed_Image.style.display='inline'; Codehighlighter1_1063_1131_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1063_1131_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1063_1131_Closed_Text.style.display='none'; Codehighlighter1_1063_1131_Open_Image.style.display='inline'; Codehighlighter1_1063_1131_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1063_1131_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1063_1131_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;(Blog)&nbsp;FindByPrimaryKey(&nbsp;</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(Blog),&nbsp;id&nbsp;);<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top">}</span></span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: left;" align="left">&nbsp;</p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">完整的<span lang="EN-US">Post</span>类如下<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 150%;"><span style="font-size: 10pt; line-height: 150%; font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 0, 0);"><br><img id="Codehighlighter1_1_47_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1_47_Open_Text.style.display='none'; Codehighlighter1_1_47_Closed_Image.style.display='inline'; Codehighlighter1_1_47_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_1_47_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1_47_Closed_Text.style.display='none'; Codehighlighter1_1_47_Open_Image.style.display='inline'; Codehighlighter1_1_47_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_1_47_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);">/**/</span><span id="Codehighlighter1_1_47_Open_Text"><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;summary&gt;</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;Post&nbsp;的摘要说明。<br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top"></span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;/summary&gt;</span><span style="color: rgb(128, 128, 128);"></span></span><br><img src="none.gif" align="top"><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top">[ActiveRecord(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Posts</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;Post&nbsp;:&nbsp;ActiveRecordBase<br><img src="none.gif" align="top"><br><img id="Codehighlighter1_112_1886_Open_Image" onclick="this.style.display='none'; Codehighlighter1_112_1886_Open_Text.style.display='none'; Codehighlighter1_112_1886_Closed_Image.style.display='inline'; Codehighlighter1_112_1886_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_112_1886_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_112_1886_Closed_Text.style.display='none'; Codehighlighter1_112_1886_Open_Image.style.display='inline'; Codehighlighter1_112_1886_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_112_1886_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_112_1886_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;_id;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;_title;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;_contents;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;_category;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;DateTime&nbsp;_created;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">bool</span><span style="color: rgb(0, 0, 0);">&nbsp;_published;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog&nbsp;_blog;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;Post()<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_358_399_Open_Image" onclick="this.style.display='none'; Codehighlighter1_358_399_Open_Text.style.display='none'; Codehighlighter1_358_399_Closed_Image.style.display='inline'; Codehighlighter1_358_399_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_358_399_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_358_399_Closed_Text.style.display='none'; Codehighlighter1_358_399_Open_Image.style.display='inline'; Codehighlighter1_358_399_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_358_399_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_358_399_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_created&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;DateTime.Now;<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;Post(Blog&nbsp;blog,&nbsp;String&nbsp;title,&nbsp;String&nbsp;contents,&nbsp;String&nbsp;category)&nbsp;:&nbsp;</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">()<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_494_611_Open_Image" onclick="this.style.display='none'; Codehighlighter1_494_611_Open_Text.style.display='none'; Codehighlighter1_494_611_Closed_Image.style.display='inline'; Codehighlighter1_494_611_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_494_611_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_494_611_Closed_Text.style.display='none'; Codehighlighter1_494_611_Open_Image.style.display='inline'; Codehighlighter1_494_611_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_494_611_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_494_611_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_blog&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;blog;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_title&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;title;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_contents&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;contents;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_category&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;category;<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[PrimaryKey(PrimaryKeyType.Native,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">post_id</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;Id<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_691_757_Open_Image" onclick="this.style.display='none'; Codehighlighter1_691_757_Open_Text.style.display='none'; Codehighlighter1_691_757_Closed_Image.style.display='inline'; Codehighlighter1_691_757_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_691_757_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_691_757_Closed_Text.style.display='none'; Codehighlighter1_691_757_Open_Image.style.display='inline'; Codehighlighter1_691_757_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_691_757_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_691_757_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_706_720_Open_Image" onclick="this.style.display='none'; Codehighlighter1_706_720_Open_Text.style.display='none'; Codehighlighter1_706_720_Closed_Image.style.display='inline'; Codehighlighter1_706_720_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_706_720_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_706_720_Closed_Text.style.display='none'; Codehighlighter1_706_720_Open_Image.style.display='inline'; Codehighlighter1_706_720_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_706_720_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_706_720_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_id;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_735_750_Open_Image" onclick="this.style.display='none'; Codehighlighter1_735_750_Open_Text.style.display='none'; Codehighlighter1_735_750_Closed_Image.style.display='inline'; Codehighlighter1_735_750_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_735_750_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_735_750_Closed_Text.style.display='none'; Codehighlighter1_735_750_Open_Image.style.display='inline'; Codehighlighter1_735_750_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_735_750_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_735_750_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_id&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[Property(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">post_title</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;Title<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_822_894_Open_Image" onclick="this.style.display='none'; Codehighlighter1_822_894_Open_Text.style.display='none'; Codehighlighter1_822_894_Closed_Image.style.display='inline'; Codehighlighter1_822_894_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_822_894_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_822_894_Closed_Text.style.display='none'; Codehighlighter1_822_894_Open_Image.style.display='inline'; Codehighlighter1_822_894_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_822_894_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_822_894_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_837_854_Open_Image" onclick="this.style.display='none'; Codehighlighter1_837_854_Open_Text.style.display='none'; Codehighlighter1_837_854_Closed_Image.style.display='inline'; Codehighlighter1_837_854_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_837_854_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_837_854_Closed_Text.style.display='none'; Codehighlighter1_837_854_Open_Image.style.display='inline'; Codehighlighter1_837_854_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_837_854_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_837_854_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_title;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_869_887_Open_Image" onclick="this.style.display='none'; Codehighlighter1_869_887_Open_Text.style.display='none'; Codehighlighter1_869_887_Closed_Image.style.display='inline'; Codehighlighter1_869_887_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_869_887_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_869_887_Closed_Text.style.display='none'; Codehighlighter1_869_887_Open_Image.style.display='inline'; Codehighlighter1_869_887_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_869_887_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_869_887_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_title&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[Property(Column</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">post_contents</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,ColumnType</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">StringClob</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;Contents<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_996_1074_Open_Image" onclick="this.style.display='none'; Codehighlighter1_996_1074_Open_Text.style.display='none'; Codehighlighter1_996_1074_Closed_Image.style.display='inline'; Codehighlighter1_996_1074_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_996_1074_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_996_1074_Closed_Text.style.display='none'; Codehighlighter1_996_1074_Open_Image.style.display='inline'; Codehighlighter1_996_1074_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_996_1074_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_996_1074_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1011_1031_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1011_1031_Open_Text.style.display='none'; Codehighlighter1_1011_1031_Closed_Image.style.display='inline'; Codehighlighter1_1011_1031_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1011_1031_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1011_1031_Closed_Text.style.display='none'; Codehighlighter1_1011_1031_Open_Image.style.display='inline'; Codehighlighter1_1011_1031_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_1011_1031_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1011_1031_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_contents;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1046_1067_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1046_1067_Open_Text.style.display='none'; Codehighlighter1_1046_1067_Closed_Image.style.display='inline'; Codehighlighter1_1046_1067_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1046_1067_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1046_1067_Closed_Text.style.display='none'; Codehighlighter1_1046_1067_Open_Image.style.display='inline'; Codehighlighter1_1046_1067_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_1046_1067_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1046_1067_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_contents&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[Property(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">post_categories</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;Category<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1147_1225_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1147_1225_Open_Text.style.display='none'; Codehighlighter1_1147_1225_Closed_Image.style.display='inline'; Codehighlighter1_1147_1225_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1147_1225_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1147_1225_Closed_Text.style.display='none'; Codehighlighter1_1147_1225_Open_Image.style.display='inline'; Codehighlighter1_1147_1225_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1147_1225_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1147_1225_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1162_1182_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1162_1182_Open_Text.style.display='none'; Codehighlighter1_1162_1182_Closed_Image.style.display='inline'; Codehighlighter1_1162_1182_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1162_1182_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1162_1182_Closed_Text.style.display='none'; Codehighlighter1_1162_1182_Open_Image.style.display='inline'; Codehighlighter1_1162_1182_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_1162_1182_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1162_1182_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_category;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1197_1218_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1197_1218_Open_Text.style.display='none'; Codehighlighter1_1197_1218_Closed_Image.style.display='inline'; Codehighlighter1_1197_1218_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1197_1218_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1197_1218_Closed_Text.style.display='none'; Codehighlighter1_1197_1218_Open_Image.style.display='inline'; Codehighlighter1_1197_1218_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_1197_1218_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1197_1218_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_category&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[BelongsTo(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">post_blogid</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog&nbsp;Blog<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1289_1359_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1289_1359_Open_Text.style.display='none'; Codehighlighter1_1289_1359_Closed_Image.style.display='inline'; Codehighlighter1_1289_1359_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1289_1359_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1289_1359_Closed_Text.style.display='none'; Codehighlighter1_1289_1359_Open_Image.style.display='inline'; Codehighlighter1_1289_1359_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1289_1359_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1289_1359_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1304_1320_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1304_1320_Open_Text.style.display='none'; Codehighlighter1_1304_1320_Closed_Image.style.display='inline'; Codehighlighter1_1304_1320_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1304_1320_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1304_1320_Closed_Text.style.display='none'; Codehighlighter1_1304_1320_Open_Image.style.display='inline'; Codehighlighter1_1304_1320_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_1304_1320_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1304_1320_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_blog;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1335_1352_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1335_1352_Open_Text.style.display='none'; Codehighlighter1_1335_1352_Closed_Image.style.display='inline'; Codehighlighter1_1335_1352_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1335_1352_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1335_1352_Closed_Text.style.display='none'; Codehighlighter1_1335_1352_Open_Image.style.display='inline'; Codehighlighter1_1335_1352_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_1335_1352_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1335_1352_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_blog&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[Property(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">post_created</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;DateTime&nbsp;Created<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1430_1506_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1430_1506_Open_Text.style.display='none'; Codehighlighter1_1430_1506_Closed_Image.style.display='inline'; Codehighlighter1_1430_1506_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1430_1506_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1430_1506_Closed_Text.style.display='none'; Codehighlighter1_1430_1506_Open_Image.style.display='inline'; Codehighlighter1_1430_1506_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1430_1506_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1430_1506_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1445_1464_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1445_1464_Open_Text.style.display='none'; Codehighlighter1_1445_1464_Closed_Image.style.display='inline'; Codehighlighter1_1445_1464_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1445_1464_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1445_1464_Closed_Text.style.display='none'; Codehighlighter1_1445_1464_Open_Image.style.display='inline'; Codehighlighter1_1445_1464_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_1445_1464_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1445_1464_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_created;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1479_1499_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1479_1499_Open_Text.style.display='none'; Codehighlighter1_1479_1499_Closed_Image.style.display='inline'; Codehighlighter1_1479_1499_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1479_1499_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1479_1499_Closed_Text.style.display='none'; Codehighlighter1_1479_1499_Open_Image.style.display='inline'; Codehighlighter1_1479_1499_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_1479_1499_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1479_1499_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_created&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;[Property(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">post_published</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">bool</span><span style="color: rgb(0, 0, 0);">&nbsp;Published<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1577_1657_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1577_1657_Open_Text.style.display='none'; Codehighlighter1_1577_1657_Closed_Image.style.display='inline'; Codehighlighter1_1577_1657_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1577_1657_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1577_1657_Closed_Text.style.display='none'; Codehighlighter1_1577_1657_Open_Image.style.display='inline'; Codehighlighter1_1577_1657_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1577_1657_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1577_1657_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1592_1613_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1592_1613_Open_Text.style.display='none'; Codehighlighter1_1592_1613_Closed_Image.style.display='inline'; Codehighlighter1_1592_1613_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1592_1613_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1592_1613_Closed_Text.style.display='none'; Codehighlighter1_1592_1613_Open_Image.style.display='inline'; Codehighlighter1_1592_1613_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_1592_1613_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1592_1613_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_published;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1628_1650_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1628_1650_Open_Text.style.display='none'; Codehighlighter1_1628_1650_Closed_Image.style.display='inline'; Codehighlighter1_1628_1650_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1628_1650_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1628_1650_Closed_Text.style.display='none'; Codehighlighter1_1628_1650_Open_Image.style.display='inline'; Codehighlighter1_1628_1650_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_1628_1650_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1628_1650_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_published&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;DeleteAll()<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1703_1763_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1703_1763_Open_Text.style.display='none'; Codehighlighter1_1703_1763_Closed_Image.style.display='inline'; Codehighlighter1_1703_1763_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1703_1763_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1703_1763_Closed_Text.style.display='none'; Codehighlighter1_1703_1763_Open_Image.style.display='inline'; Codehighlighter1_1703_1763_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1703_1763_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1703_1763_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ActiveRecordBase.DeleteAll(&nbsp;</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(Post)&nbsp;);<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;Post[]&nbsp;FindAll()<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_1809_1883_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1809_1883_Open_Text.style.display='none'; Codehighlighter1_1809_1883_Closed_Image.style.display='inline'; Codehighlighter1_1809_1883_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_1809_1883_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1809_1883_Closed_Text.style.display='none'; Codehighlighter1_1809_1883_Open_Image.style.display='inline'; Codehighlighter1_1809_1883_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1809_1883_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_1809_1883_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;(Post[])&nbsp;ActiveRecordBase.FindAll(&nbsp;</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(Post)&nbsp;);<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top">}</span></span></div>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><b style=""><span style="font-size: 10pt; color: rgb(0, 102, 153); line-height: 200%; font-family: 宋体;"><br>三．构建配置信息<span lang="EN-US"><o:p></o:p></span></span></b></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">这里我采用上篇中将过的<span lang="EN-US">XML</span>配置方式</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 0, 255);">&lt;?</span><span style="color: rgb(255, 0, 255);">xml&nbsp;version="1.0"&nbsp;encoding="utf-8"&nbsp;</span><span style="color: rgb(0, 0, 255);">?&gt;</span><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">activerecord</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">config</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">add&nbsp;</span><span style="color: rgb(255, 0, 0);">key</span><span style="color: rgb(0, 0, 255);">="hibernate.connection.driver_class"</span><span style="color: rgb(255, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 255);">="NHibernate.Driver.SqlClientDriver"</span><span style="color: rgb(255, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">add&nbsp;</span><span style="color: rgb(255, 0, 0);">key</span><span style="color: rgb(0, 0, 255);">="hibernate.dialect"</span><span style="color: rgb(255, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 255);">="NHibernate.Dialect.MsSql2000Dialect"</span><span style="color: rgb(255, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">add&nbsp;</span><span style="color: rgb(255, 0, 0);">key</span><span style="color: rgb(0, 0, 255);">="hibernate.connection.provider"</span><span style="color: rgb(255, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 255);">="NHibernate.Connection.DriverConnectionProvider"</span><span style="color: rgb(255, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">add&nbsp;</span><span style="color: rgb(255, 0, 0);">key</span><span style="color: rgb(0, 0, 255);">="hibernate.connection.connection_string"</span><span style="color: rgb(255, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 255);">="Data&nbsp;Source=.;Initial&nbsp;Catalog=test;Integrated&nbsp;Security=SSPI"</span><span style="color: rgb(255, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top"><br><img src="none.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">config</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">activerecord</span><span style="color: rgb(0, 0, 255);">&gt;</span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: left;" align="left">&nbsp;</p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><b style=""><span style="font-size: 10pt; color: rgb(0, 102, 153); line-height: 200%; font-family: 宋体;">四．编写测试代码<span lang="EN-US"><o:p></o:p></span></span></b></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">1</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">．级联增加：新增一个<span lang="EN-US">Blog</span>，并同时添加相关的<span lang="EN-US">Post</span>到数据表中</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><br></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">[Test]<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;TestCascadingSave()<br><img src="none.gif" align="top"><br><img id="Codehighlighter1_41_816_Open_Image" onclick="this.style.display='none'; Codehighlighter1_41_816_Open_Text.style.display='none'; Codehighlighter1_41_816_Closed_Image.style.display='inline'; Codehighlighter1_41_816_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_41_816_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_41_816_Closed_Text.style.display='none'; Codehighlighter1_41_816_Open_Image.style.display='inline'; Codehighlighter1_41_816_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_41_816_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_41_816_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">创建Blog对象</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;Blog&nbsp;blog&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog();<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;blog.Name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Terrylee's&nbsp;Tech&nbsp;Space</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;blog.Author&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Terrylee</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">执行事务，持久化对象到数据库</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">(TransactionScope&nbsp;tran&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;TransactionScope())<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_248_742_Open_Image" onclick="this.style.display='none'; Codehighlighter1_248_742_Open_Text.style.display='none'; Codehighlighter1_248_742_Closed_Image.style.display='inline'; Codehighlighter1_248_742_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_248_742_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_248_742_Closed_Text.style.display='none'; Codehighlighter1_248_742_Open_Image.style.display='inline'; Codehighlighter1_248_742_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_248_742_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_248_742_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_272_664_Open_Image" onclick="this.style.display='none'; Codehighlighter1_272_664_Open_Text.style.display='none'; Codehighlighter1_272_664_Closed_Image.style.display='inline'; Codehighlighter1_272_664_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_272_664_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_272_664_Closed_Text.style.display='none'; Codehighlighter1_272_664_Open_Image.style.display='inline'; Codehighlighter1_272_664_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_272_664_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_272_664_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blog.Create();<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">11</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">)<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_364_618_Open_Image" onclick="this.style.display='none'; Codehighlighter1_364_618_Open_Text.style.display='none'; Codehighlighter1_364_618_Closed_Image.style.display='inline'; Codehighlighter1_364_618_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_364_618_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_364_618_Closed_Text.style.display='none'; Codehighlighter1_364_618_Open_Image.style.display='inline'; Codehighlighter1_364_618_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_364_618_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_364_618_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">创建Post对象</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Post&nbsp;post&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;Post();<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Title</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">This&nbsp;is&nbsp;my&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">i.ToString()</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;post</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Category</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Castle</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Blog&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;blog;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Save();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tran.VoteCommit();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_690_735_Open_Image" onclick="this.style.display='none'; Codehighlighter1_690_735_Open_Text.style.display='none'; Codehighlighter1_690_735_Closed_Image.style.display='inline'; Codehighlighter1_690_735_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_690_735_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_690_735_Closed_Text.style.display='none'; Codehighlighter1_690_735_Open_Image.style.display='inline'; Codehighlighter1_690_735_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_690_735_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_690_735_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tran.VoteRollBack();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;The&nbsp;changes&nbsp;will&nbsp;be&nbsp;sent&nbsp;to&nbsp;the&nbsp;DB&nbsp;when&nbsp;the&nbsp;session&nbsp;is&nbsp;disposed&nbsp;here</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="expandedblockend.gif" align="top">}</span></span></div>
<br>2<span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">．级联更新：<br></span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">首先我们为一个已经存在的<span lang="EN-US">Blog</span>增加多个<span lang="EN-US">Post<o:p></o:p></span></span>
<p>&nbsp;</p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;"></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">[Test]<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;TestCascadingUpdate()<br><img src="none.gif" align="top"><br><img id="Codehighlighter1_43_758_Open_Image" onclick="this.style.display='none'; Codehighlighter1_43_758_Open_Text.style.display='none'; Codehighlighter1_43_758_Closed_Image.style.display='inline'; Codehighlighter1_43_758_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_43_758_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_43_758_Closed_Text.style.display='none'; Codehighlighter1_43_758_Open_Image.style.display='inline'; Codehighlighter1_43_758_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_43_758_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_43_758_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">找到ID为5的Blog</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;Blog&nbsp;blog&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog.Find(</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">);<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">执行事务，持久化对象到数据库</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">(TransactionScope&nbsp;tran&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;TransactionScope())<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_187_755_Open_Image" onclick="this.style.display='none'; Codehighlighter1_187_755_Open_Text.style.display='none'; Codehighlighter1_187_755_Closed_Image.style.display='inline'; Codehighlighter1_187_755_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_187_755_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_187_755_Closed_Text.style.display='none'; Codehighlighter1_187_755_Open_Image.style.display='inline'; Codehighlighter1_187_755_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_187_755_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_187_755_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_211_677_Open_Image" onclick="this.style.display='none'; Codehighlighter1_211_677_Open_Text.style.display='none'; Codehighlighter1_211_677_Closed_Image.style.display='inline'; Codehighlighter1_211_677_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_211_677_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_211_677_Closed_Text.style.display='none'; Codehighlighter1_211_677_Open_Image.style.display='inline'; Codehighlighter1_211_677_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_211_677_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_211_677_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">)<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_271_589_Open_Image" onclick="this.style.display='none'; Codehighlighter1_271_589_Open_Text.style.display='none'; Codehighlighter1_271_589_Closed_Image.style.display='inline'; Codehighlighter1_271_589_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_271_589_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_271_589_Closed_Text.style.display='none'; Codehighlighter1_271_589_Open_Image.style.display='inline'; Codehighlighter1_271_589_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_271_589_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_271_589_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">创建Post对象</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Post&nbsp;post&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;Post();<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Title</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">This&nbsp;is&nbsp;my&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">i.ToString()</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;post</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Category</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Castle</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Save();<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">注意这句</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blog.Posts.Add(post);<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blog.Update();<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tran.VoteCommit();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_703_748_Open_Image" onclick="this.style.display='none'; Codehighlighter1_703_748_Open_Text.style.display='none'; Codehighlighter1_703_748_Closed_Image.style.display='inline'; Codehighlighter1_703_748_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_703_748_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_703_748_Closed_Text.style.display='none'; Codehighlighter1_703_748_Open_Image.style.display='inline'; Codehighlighter1_703_748_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_703_748_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_703_748_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tran.VoteRollBack();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top">}</span></span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><br>当然上面的更新代码也可以这样去写：<span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;"></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">[Test]<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;TestCascadingUpdate()<br><img src="none.gif" align="top"><br><img id="Codehighlighter1_43_692_Open_Image" onclick="this.style.display='none'; Codehighlighter1_43_692_Open_Text.style.display='none'; Codehighlighter1_43_692_Closed_Image.style.display='inline'; Codehighlighter1_43_692_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_43_692_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_43_692_Closed_Text.style.display='none'; Codehighlighter1_43_692_Open_Image.style.display='inline'; Codehighlighter1_43_692_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_43_692_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_43_692_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">找到ID为5的Blog</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;Blog&nbsp;blog&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog.Find(</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">);<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">执行事务，持久化对象到数据库</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">(TransactionScope&nbsp;tran&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;TransactionScope())<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_187_689_Open_Image" onclick="this.style.display='none'; Codehighlighter1_187_689_Open_Text.style.display='none'; Codehighlighter1_187_689_Closed_Image.style.display='inline'; Codehighlighter1_187_689_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_187_689_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_187_689_Closed_Text.style.display='none'; Codehighlighter1_187_689_Open_Image.style.display='inline'; Codehighlighter1_187_689_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_187_689_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_187_689_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_211_611_Open_Image" onclick="this.style.display='none'; Codehighlighter1_211_611_Open_Text.style.display='none'; Codehighlighter1_211_611_Closed_Image.style.display='inline'; Codehighlighter1_211_611_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_211_611_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_211_611_Closed_Text.style.display='none'; Codehighlighter1_211_611_Open_Image.style.display='inline'; Codehighlighter1_211_611_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_211_611_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_211_611_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">)<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_271_558_Open_Image" onclick="this.style.display='none'; Codehighlighter1_271_558_Open_Text.style.display='none'; Codehighlighter1_271_558_Closed_Image.style.display='inline'; Codehighlighter1_271_558_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_271_558_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_271_558_Closed_Text.style.display='none'; Codehighlighter1_271_558_Open_Image.style.display='inline'; Codehighlighter1_271_558_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_271_558_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_271_558_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">创建Post对象</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Post&nbsp;post&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;Post();<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Title</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">This&nbsp;is&nbsp;my&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">i.ToString()</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;post</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Category</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Castle</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">在这儿指定它们的关联</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Blog&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;blog;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Save();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tran.VoteCommit();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_637_682_Open_Image" onclick="this.style.display='none'; Codehighlighter1_637_682_Open_Text.style.display='none'; Codehighlighter1_637_682_Closed_Image.style.display='inline'; Codehighlighter1_637_682_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_637_682_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_637_682_Closed_Text.style.display='none'; Codehighlighter1_637_682_Open_Image.style.display='inline'; Codehighlighter1_637_682_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_637_682_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_637_682_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tran.VoteRollBack();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top">}</span></span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><br>但是如果我们去掉<span lang="EN-US">post.Save()</span>这句话，就会发现<span lang="EN-US">Post</span>并没有增加到库中：<span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;"></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">[Test]<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;TestCascadingUpdate()<br><img src="none.gif" align="top"><br><img id="Codehighlighter1_43_757_Open_Image" onclick="this.style.display='none'; Codehighlighter1_43_757_Open_Text.style.display='none'; Codehighlighter1_43_757_Closed_Image.style.display='inline'; Codehighlighter1_43_757_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_43_757_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_43_757_Closed_Text.style.display='none'; Codehighlighter1_43_757_Open_Image.style.display='inline'; Codehighlighter1_43_757_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_43_757_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_43_757_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">找到ID为5的Blog</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;Blog&nbsp;blog&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog.Find(</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">);<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">执行事务，持久化对象到数据库</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">(TransactionScope&nbsp;tran&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;TransactionScope())<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_187_754_Open_Image" onclick="this.style.display='none'; Codehighlighter1_187_754_Open_Text.style.display='none'; Codehighlighter1_187_754_Closed_Image.style.display='inline'; Codehighlighter1_187_754_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_187_754_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_187_754_Closed_Text.style.display='none'; Codehighlighter1_187_754_Open_Image.style.display='inline'; Codehighlighter1_187_754_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_187_754_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_187_754_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_211_676_Open_Image" onclick="this.style.display='none'; Codehighlighter1_211_676_Open_Text.style.display='none'; Codehighlighter1_211_676_Closed_Image.style.display='inline'; Codehighlighter1_211_676_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_211_676_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_211_676_Closed_Text.style.display='none'; Codehighlighter1_211_676_Open_Image.style.display='inline'; Codehighlighter1_211_676_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_211_676_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_211_676_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">;i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">)<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_271_592_Open_Image" onclick="this.style.display='none'; Codehighlighter1_271_592_Open_Text.style.display='none'; Codehighlighter1_271_592_Closed_Image.style.display='inline'; Codehighlighter1_271_592_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_271_592_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_271_592_Closed_Text.style.display='none'; Codehighlighter1_271_592_Open_Image.style.display='inline'; Codehighlighter1_271_592_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_271_592_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_271_592_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">创建Post对象</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Post&nbsp;post&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;Post();<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Title</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">This&nbsp;is&nbsp;my&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">i.ToString()</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;post</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post.Category</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Castle</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">注释掉这句<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">post.Save();</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blog.Posts.Add(post);<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blog.Update();<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tran.VoteCommit();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_702_747_Open_Image" onclick="this.style.display='none'; Codehighlighter1_702_747_Open_Text.style.display='none'; Codehighlighter1_702_747_Closed_Image.style.display='inline'; Codehighlighter1_702_747_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_702_747_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_702_747_Closed_Text.style.display='none'; Codehighlighter1_702_747_Open_Image.style.display='inline'; Codehighlighter1_702_747_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_702_747_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_702_747_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tran.VoteRollBack();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top">}</span></span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><br>此时，必须修改我们的<span lang="EN-US">Blog</span>类，设置级联操作为<span lang="EN-US">SaveUpdate</span>，上面的代码才可以正常执行<span style="font-size: 10pt; line-height: 200%; font-family: 宋体;"></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;<img src="dot.gif"><img src="dot.gif"></span><span style="color: rgb(0, 128, 0);"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top">[HasMany(</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(Post),&nbsp;Table</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">posts</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;ColumnKey</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">post_blogid</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,Cascade</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">ManyRelationCascadeEnum.SaveUpdate)]<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;IList&nbsp;Posts<br><img src="none.gif" align="top"><br><img id="Codehighlighter1_139_199_Open_Image" onclick="this.style.display='none'; Codehighlighter1_139_199_Open_Text.style.display='none'; Codehighlighter1_139_199_Closed_Image.style.display='inline'; Codehighlighter1_139_199_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_139_199_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_139_199_Closed_Text.style.display='none'; Codehighlighter1_139_199_Open_Image.style.display='inline'; Codehighlighter1_139_199_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_139_199_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_139_199_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_150_167_Open_Image" onclick="this.style.display='none'; Codehighlighter1_150_167_Open_Text.style.display='none'; Codehighlighter1_150_167_Closed_Image.style.display='inline'; Codehighlighter1_150_167_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_150_167_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_150_167_Closed_Text.style.display='none'; Codehighlighter1_150_167_Open_Image.style.display='inline'; Codehighlighter1_150_167_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_150_167_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_150_167_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_posts;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_178_196_Open_Image" onclick="this.style.display='none'; Codehighlighter1_178_196_Open_Text.style.display='none'; Codehighlighter1_178_196_Closed_Image.style.display='inline'; Codehighlighter1_178_196_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_178_196_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_178_196_Closed_Text.style.display='none'; Codehighlighter1_178_196_Open_Image.style.display='inline'; Codehighlighter1_178_196_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_178_196_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_178_196_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_posts&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top">}</span></span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%; text-align: left;" align="left"><br>下面再测试一个删除某一个<span lang="EN-US">Blog</span>的某些<span lang="EN-US">Post</span>后，再保存<span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;"></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">[Test]<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;TestCascadingUpdateDel()<br><img src="none.gif" align="top"><br><img id="Codehighlighter1_46_553_Open_Image" onclick="this.style.display='none'; Codehighlighter1_46_553_Open_Text.style.display='none'; Codehighlighter1_46_553_Closed_Image.style.display='inline'; Codehighlighter1_46_553_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_46_553_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_46_553_Closed_Text.style.display='none'; Codehighlighter1_46_553_Open_Image.style.display='inline'; Codehighlighter1_46_553_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_46_553_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_46_553_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">找到ID为7的Blog</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;Blog&nbsp;blog&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog.Find(</span><span style="color: rgb(0, 0, 0);">7</span><span style="color: rgb(0, 0, 0);">);<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;expectedCount&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;blog.Posts.Count;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">(TransactionScope&nbsp;tran&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;TransactionScope())<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_214_441_Open_Image" onclick="this.style.display='none'; Codehighlighter1_214_441_Open_Text.style.display='none'; Codehighlighter1_214_441_Closed_Image.style.display='inline'; Codehighlighter1_214_441_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_214_441_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_214_441_Closed_Text.style.display='none'; Codehighlighter1_214_441_Open_Image.style.display='inline'; Codehighlighter1_214_441_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_214_441_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_214_441_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_238_363_Open_Image" onclick="this.style.display='none'; Codehighlighter1_238_363_Open_Text.style.display='none'; Codehighlighter1_238_363_Closed_Image.style.display='inline'; Codehighlighter1_238_363_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_238_363_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_238_363_Closed_Text.style.display='none'; Codehighlighter1_238_363_Open_Image.style.display='inline'; Codehighlighter1_238_363_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_238_363_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_238_363_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blog.Posts.RemoveAt(</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">);<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blog.Update();<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tran.VoteCommit();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_389_434_Open_Image" onclick="this.style.display='none'; Codehighlighter1_389_434_Open_Text.style.display='none'; Codehighlighter1_389_434_Closed_Image.style.display='inline'; Codehighlighter1_389_434_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_389_434_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_389_434_Closed_Text.style.display='none'; Codehighlighter1_389_434_Open_Image.style.display='inline'; Codehighlighter1_389_434_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_389_434_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_389_434_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tran.VoteRollBack();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;actualCount&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog.Find(</span><span style="color: rgb(0, 0, 0);">7</span><span style="color: rgb(0, 0, 0);">).Posts.Count;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;Assert.AreEqual(expectedCount</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">,actualCount);<br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top">}</span></span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><br>上面这段代码测试可以通过，但是我们会发现表<span lang="EN-US">Posts</span>中会有一些记录没有<span lang="EN-US">BlogId</span>，修改<span lang="EN-US">Blog</span>实体类重新设置级联操作，就可以正常删除了：<span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;<img src="dot.gif"><img src="dot.gif"></span><span style="color: rgb(0, 128, 0);"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="none.gif" align="top">[HasMany(</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(Post),&nbsp;Table</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">posts</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;ColumnKey</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">post_blogid</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,Cascade</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">ManyRelationCascadeEnum.AllDeleteOrphan)]<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;IList&nbsp;Posts<br><img src="none.gif" align="top"><br><img id="Codehighlighter1_144_204_Open_Image" onclick="this.style.display='none'; Codehighlighter1_144_204_Open_Text.style.display='none'; Codehighlighter1_144_204_Closed_Image.style.display='inline'; Codehighlighter1_144_204_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_144_204_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_144_204_Closed_Text.style.display='none'; Codehighlighter1_144_204_Open_Image.style.display='inline'; Codehighlighter1_144_204_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_144_204_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_144_204_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_155_172_Open_Image" onclick="this.style.display='none'; Codehighlighter1_155_172_Open_Text.style.display='none'; Codehighlighter1_155_172_Closed_Image.style.display='inline'; Codehighlighter1_155_172_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_155_172_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_155_172_Closed_Text.style.display='none'; Codehighlighter1_155_172_Open_Image.style.display='inline'; Codehighlighter1_155_172_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_155_172_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_155_172_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_posts;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_183_201_Open_Image" onclick="this.style.display='none'; Codehighlighter1_183_201_Open_Text.style.display='none'; Codehighlighter1_183_201_Closed_Image.style.display='inline'; Codehighlighter1_183_201_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_183_201_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_183_201_Closed_Text.style.display='none'; Codehighlighter1_183_201_Open_Image.style.display='inline'; Codehighlighter1_183_201_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_183_201_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_183_201_Open_Text"><span style="color: rgb(0, 0, 0);">{&nbsp;_posts&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top">}</span></span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><br>3<span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">．级联删除<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">删除一个<span lang="EN-US">Blog</span>对象后，对应的<span lang="EN-US">Post</span>对象应该全部删除<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;"></span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">[Test]<br><img src="none.gif" align="top"><br><img src="none.gif" align="top"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;TestCascadingDelete()<br><img src="none.gif" align="top"><br><img id="Codehighlighter1_43_343_Open_Image" onclick="this.style.display='none'; Codehighlighter1_43_343_Open_Text.style.display='none'; Codehighlighter1_43_343_Closed_Image.style.display='inline'; Codehighlighter1_43_343_Closed_Text.style.display='inline';" src="expandedblockstart.gif" align="top"><img id="Codehighlighter1_43_343_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_43_343_Closed_Text.style.display='none'; Codehighlighter1_43_343_Open_Image.style.display='inline'; Codehighlighter1_43_343_Open_Text.style.display='inline';" src="contractedblock.gif" align="top"></span><span id="Codehighlighter1_43_343_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_43_343_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">找到ID为7的Blog对象</span><span style="color: rgb(0, 128, 0);"><br><img src="inblock.gif" align="top"></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;Blog&nbsp;blog&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;Blog.Find(</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">);<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">(TransactionScope&nbsp;tran&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;TransactionScope())<br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_164_340_Open_Image" onclick="this.style.display='none'; Codehighlighter1_164_340_Open_Text.style.display='none'; Codehighlighter1_164_340_Closed_Image.style.display='inline'; Codehighlighter1_164_340_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_164_340_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_164_340_Closed_Text.style.display='none'; Codehighlighter1_164_340_Open_Image.style.display='inline'; Codehighlighter1_164_340_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_164_340_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_164_340_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_188_262_Open_Image" onclick="this.style.display='none'; Codehighlighter1_188_262_Open_Text.style.display='none'; Codehighlighter1_188_262_Closed_Image.style.display='inline'; Codehighlighter1_188_262_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_188_262_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_188_262_Closed_Text.style.display='none'; Codehighlighter1_188_262_Open_Image.style.display='inline'; Codehighlighter1_188_262_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_188_262_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_188_262_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;blog.Delete();<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tran.VoteCommit();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img id="Codehighlighter1_288_333_Open_Image" onclick="this.style.display='none'; Codehighlighter1_288_333_Open_Text.style.display='none'; Codehighlighter1_288_333_Closed_Image.style.display='inline'; Codehighlighter1_288_333_Closed_Text.style.display='inline';" src="expandedsubblockstart.gif" align="top"><img id="Codehighlighter1_288_333_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_288_333_Closed_Text.style.display='none'; Codehighlighter1_288_333_Open_Image.style.display='inline'; Codehighlighter1_288_333_Open_Text.style.display='inline';" src="contractedsubblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_288_333_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img src="dot.gif"></span><span id="Codehighlighter1_288_333_Open_Text"><span style="color: rgb(0, 0, 0);">{<br><img src="inblock.gif" align="top"><br><img src="inblock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tran.VoteRollBack();<br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedsubblockend.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br><img src="inblock.gif" align="top"><br><img src="expandedblockend.gif" align="top">}</span></span></div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><br>同样要注意设置级联操作。<span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">关于<span lang="EN-US">One-Many</span>关联映射就介绍这么多了，至于<span lang="EN-US">Many-One</span>关联同<span lang="EN-US">One-Many</span>，只不过对<span lang="EN-US">HasMany</span>和<span lang="EN-US">BlongsTo</span>设置的位置不一样而已，在下一篇文章中我会介绍在<span lang="EN-US">ActiveRecord</span>中实现<span lang="EN-US">Many-Many</span>关联映射。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><b style=""><span style="font-size: 10pt; color: rgb(0, 102, 153); line-height: 200%; font-family: 宋体;">参考资料<span lang="EN-US"><o:p></o:p></span></span></b></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 200%;"><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;" lang="EN-US">Castle</span><span style="font-size: 10pt; line-height: 200%; font-family: 宋体;">的官方网站<span lang="EN-US"><a href="http://www.castleproject.org/">http://www.castleproject.org</a></span></span></p>
<div id="MySignature">作者：<a href="http://terrylee.cnblogs.com/">TerryLee</a><br>
出处：<a href="http://terrylee.cnblogs.com/">http://terrylee.cnblogs.com</a>
<br>
本文版权归作者和博客园共有，欢迎转载，但未经作者同意必须保留此段声明，且在文章页面明显位置给出原文连接，否则保留追究法律责任的权利。
</div>
<div id="digg_block">
<div id="div_digg">										
	<div class="diggit" onclick="DiggIt(368471,14203,1)"> 
		<span class="diggnum" id="digg_count_368471">0</span>
	</div>
	<div class="buryit" onclick="DiggIt(368471,14203,2)"> 
		<span class="burynum" id="bury_count_368471">0</span>
	</div>
	<div class="clear"></div>
	<span style="display: none;" id="span_isdigged_368471">0</span>	
	<div class="diggword" id="digg_word_368471">(请您对文章做出评价)</div>	
</div>
</div>
<div class="clear"></div>
<div id="post_next_prev">
<a href="http://www.cnblogs.com/Terrylee/archive/2006/04/06/367978.html">« </a> 上一篇：<a href="http://www.cnblogs.com/Terrylee/archive/2006/04/06/367978.html" title="发布于2006-04-06 08:28">Castle ActiveRecord学习实践（3）：映射基础</a><br>
<a href="http://www.cnblogs.com/Terrylee/archive/2006/04/10/370950.html">» </a> 下一篇：<a href="http://www.cnblogs.com/Terrylee/archive/2006/04/10/370950.html" title="发布于2006-04-10 08:17">Castle ActiveRecord学习实践（5）：实现Many–Many关系的映射</a><br>
</div>








		</div>
		<div class="postDesc">posted @ 2006-04-06 16:28 <a href="http://www.cnblogs.com/Terrylee/">TerryLee</a> 阅读(13558) <a href="#commentform">评论(63)</a> &nbsp;<a href="http://www.cnblogs.com/Terrylee/admin/EditPosts.aspx?postid=368471">编辑</a> <a href="http://www.cnblogs.com/Terrylee/AddToFavorite.aspx?id=368471">收藏</a> <a href="#" onclick="PutInWz();return false;">网摘</a>  所属分类: <a href="http://www.cnblogs.com/Terrylee/category/48535.html">[11]&nbsp;&nbsp;数据持久</a>, <a href="http://www.cnblogs.com/Terrylee/category/53293.html">[12]&nbsp;&nbsp;开源世界</a></div>
	</div>
	<img src="368471.html" height="1" width="1">
	
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/Terrylee/archive/2006/04/06/368471.html"
dc:identifier="http://www.cnblogs.com/Terrylee/archive/2006/04/06/368471.html"
dc:title=""
trackback:ping="http://www.cnblogs.com/Terrylee/services/trackbacks/368471.aspx" />
</rdf:RDF>
-->

</div><!--end: topics 文章、评论容器-->
<a name="pagedcomment"></a>
<!--done-->
<br>
<div class="feedback_area_title">发表评论</div>
<div class="feedbackNoItems"><span id="span_comment_maxid" style="display: none;">1648720</span></div>
	

		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("CrazyWill",368813,"/kNAIbWXtOovJqIXLbEsW8Z8v9sivzpoXvD8Ao/smNW+qmWNSsMwXA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(368813,"/kNAIbWXtOovJqIXLbEsW8Z8v9sivzpoXvD8Ao/smNW+qmWNSsMwXA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=CrazyWill" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl00$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#368813">#1楼</a><a name="368813" id="comment_anchor_368813"></a>2006-04-06 23:27 | <a id="Comments1_CommentList_ctl00_NameLink" href="http://www.cnblogs.com/CrazyWill/" target="_top">CrazyWill</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/CrazyWill" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_368813" class="blog_comment_body">你的Post类写的有问题，没有办法测试通过。下面是我修改好的。
<br>
<br>using System;
<br>using Castle.ActiveRecord;
<br>using CastleTest;
<br>/**//// &lt;summary&gt;
<br>
<br>/// Post 的摘要说明。
<br>
<br>/// &lt;/summary&gt;
<br>
<br>[ActiveRecord("Posts")]
<br>
<br>public class Post : ActiveRecordBase
<br>
<br>{
<br>
<br>	private int _id;
<br>
<br> 
<br>
<br>	private String _title;
<br>
<br> 
<br>
<br>	private String _contents;
<br>
<br> 
<br>
<br>	private String _category;
<br>
<br> 
<br>
<br>	private DateTime _created;
<br>
<br> 
<br>
<br>	private bool _published;
<br>
<br> 
<br>
<br>	private Blog _blog;
<br>
<br> 
<br>
<br>	public Post()
<br>
<br>	{
<br>
<br>		_created = DateTime.Now;
<br>
<br>	}
<br>
<br> 
<br>
<br>	public Post(Blog blog, String title, String contents, String category) : this()
<br>
<br>	{
<br>
<br>		_blog = blog;
<br>
<br>		_title = title;
<br>
<br>		_contents = contents;
<br>
<br>		_category = category;
<br>
<br>	}
<br>
<br> 
<br>
<br>	[PrimaryKey(PrimaryKeyType.Native,"post_id")]
<br>
<br>	public int Id
<br>
<br>	{
<br>
<br>		get { return _id; }
<br>
<br>		set { _id = value; }
<br>
<br>	}
<br>
<br> 
<br>
<br>	[Property("post_title")]
<br>
<br>	public String Title
<br>
<br>	{
<br>
<br>		get { return _title; }
<br>
<br>		set { _title = value; }
<br>
<br>	}
<br>
<br> 
<br>
<br>	[Property(Column="post_contents",ColumnType="StringClob")]
<br>
<br>	public String Contents
<br>
<br>	{
<br>
<br>		get { return _contents; }
<br>
<br>		set { _contents = value; }
<br>
<br>	}
<br>
<br> 
<br>
<br>	[Property("post_categories")]
<br>
<br>	public String Category
<br>
<br>	{
<br>
<br>		get { return _category; }
<br>
<br>		set { _category = value; }
<br>
<br>	}
<br>
<br> 
<br>
<br>	[BelongsTo("post_blogid")]
<br>
<br>	public Blog Blog
<br>
<br>	{
<br>
<br>		get { return _blog; }
<br>
<br>		set { _blog = value; }
<br>
<br>	}
<br>
<br> 
<br>
<br>	[Property("post_created")]
<br>
<br>	public DateTime Created
<br>
<br>	{
<br>
<br>		get { return _created; }
<br>
<br>		set { _created = value; }
<br>
<br>	}
<br>
<br> 
<br>
<br>	[Property("post_published")]
<br>
<br>	public bool Published
<br>
<br>	{
<br>
<br>		get { return _published; }
<br>
<br>		set { _published = value; }
<br>
<br>	}
<br>
<br> 
<br>
<br>	public static void DeleteAll()
<br>
<br>	{
<br>
<br>		ActiveRecordBase.DeleteAll( typeof(Post) );
<br>
<br>	}
<br>
<br> 
<br>
<br>	public static Post[] FindAll()
<br>
<br>	{
<br>
<br>		return (Post[]) ActiveRecordBase.FindAll( typeof(Post) );
<br>
<br>	}
<br>
<br>}</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Terrylee",368886,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(368886,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Terrylee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl01$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#368886">#2楼</a><a name="368886" id="comment_anchor_368886"></a>[<span class="louzhu">楼主</span>]2006-04-07 08:21 | <a id="Comments1_CommentList_ctl01_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">Terrylee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Terrylee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_368886" class="blog_comment_body">@CrazyWill
<br>晕，贴错代码了：-）
<br>
<br>谢谢，我找时间改过来</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Terrylee",370445,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(370445,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Terrylee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl02$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#370445">#3楼</a><a name="370445" id="comment_anchor_370445"></a>[<span class="louzhu">楼主</span>]2006-04-09 08:48 | <a id="Comments1_CommentList_ctl02_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">Terrylee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Terrylee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_370445" class="blog_comment_body">终于更正过来了
<br>公司里网络总是发不上去，耽误了大家这么长时间，实在不好意思：）</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("SK",398392,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(398392,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl03_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl03$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl03_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#398392">#4楼</a><a name="398392" id="comment_anchor_398392"></a>2006-05-12 14:57 | <a id="Comments1_CommentList_ctl03_NameLink" target="_blank">SK[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_398392" class="blog_comment_body">IConfigurationSource需要using哪个命名空间?</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Terrylee",399577,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(399577,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Terrylee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl04_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl04$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl04_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#399577">#5楼</a><a name="399577" id="comment_anchor_399577"></a>[<span class="louzhu">楼主</span>]2006-05-14 08:41 | <a id="Comments1_CommentList_ctl04_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">Terrylee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Terrylee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_399577" class="blog_comment_body">@SK
<br>命名空间：Castle.ActiveRecord.Framework</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("aihu03071",402624,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(402624,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl05_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl05$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl05_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#402624">#6楼</a><a name="402624" id="comment_anchor_402624"></a>2006-05-17 17:05 | <a id="Comments1_CommentList_ctl05_NameLink" target="_blank">aihu03071[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_402624" class="blog_comment_body">这里我在调试的时候碰到了几个问题，
<br>一个就是ActiveRecordStarter.Initialize方法的第二个参数是一个param 的类型，所以所有type初始化都是在一个方法里完成了，我先前把他搞成两个了
<br>还有就是Post类构造函数里设置时间初始值的那句好像是必须的，ActiveRecord好像不能自动将数据库时间类型的值设为null，它必须有一个初始值
<br>这些只是我个人测试的结果，希望高手指点</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("xu",414741,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(414741,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl06_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl06$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl06_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#414741">#7楼</a><a name="414741" id="comment_anchor_414741"></a>2006-06-01 11:51 | <a id="Comments1_CommentList_ctl06_NameLink" target="_blank">xu[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_414741" class="blog_comment_body">     请问我发现好像所有的主键都是自动增加，我在做试验的时候，发现如果不递增，就会报错，不能保存，修改。请问能否把表的主键改为不递增，能否用上面的方法实现。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("SHY520",414779,"Sh7Z4AC9GuboJ6V5xtbU/KCAXYZvTsUd+aad2pTDA71VXOgM2RkXwA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(414779,"Sh7Z4AC9GuboJ6V5xtbU/KCAXYZvTsUd+aad2pTDA71VXOgM2RkXwA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=SHY520" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl07_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl07$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl07_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#414779">#8楼</a><a name="414779" id="comment_anchor_414779"></a>2006-06-01 12:41 | <a id="Comments1_CommentList_ctl07_NameLink" href="http://www.cnblogs.com/pw/" target="_top">SHY520</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/SHY520" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_414779" class="blog_comment_body">@xu
<br>可能是你的PrimaryKeyType设置问题
<br>
<br>主键的生成方式介绍
<br>
<br>Identity
<br> 对DB2,MySQL, MS SQL Server, Sybase和HypersonicSQL的内置标识字段提供支持，生成自增的整型
<br> 
<br>Sequence
<br> 序列，对DB2,MySQL, PostgreSQL, Oracle的内置标识字段提供支持，生成自增的整型。
<br> 
<br>HiLo
<br> 高低位,使用一个高/低位算法来高效的生成Int64, Int32 或者 Int16类型的标识符。
<br> 
<br>SeqHiLo
<br> 使用序列的高低位,使用一个高/低位算法来高效的生成Int64, Int32 或者 Int16类型的标识符，给定一个数据库序列（sequence)的名字。
<br> 
<br>UuidHex
<br> 用一个System.Guid和它的ToString(string format)方法生成字符串类型的标识符。
<br> 
<br>UuidString
<br> 用一个新的System.Guid产生一个byte[] ，把它转换成字符串。
<br> 
<br>Guid
<br> 用一个新的System.Guid 作为标识符。
<br> 
<br>GuidComb
<br> 用Jimmy Nilsso的一个算法产生一个新的System.Guid。
<br> 
<br>Native
<br> 根据底层数据库的能力选择 identity, sequence 或者 hilo中的一个。默认值。
<br> 
<br>Assigned
<br> 让应用程序在自己为对象分配一个标示符。
<br> 
<br>Foreign
<br> 使用另外一个相关联的对象的标识符。
<br> 
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",414812,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(414812,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl08_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl08$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl08_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#414812">#9楼</a><a name="414812" id="comment_anchor_414812"></a>[<span class="louzhu">楼主</span>]2006-06-01 13:11 | <a id="Comments1_CommentList_ctl08_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_414812" class="blog_comment_body">@xu
<br>请参考
<br><a target="_new" href="http://terrylee.cnblogs.com/archive/2006/04/06/367978.html">http://terrylee.cnblogs.com/archive/2006/04/06/367978.html</a>
<br>关于主键类型PrimaryKeyType的描述</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("一汐",433576,"hxSHKPBq4rNYJlC3gwvQK9eA+/GVbexTQuczFlcY0tMwdVE23mxt7Q==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(433576,"hxSHKPBq4rNYJlC3gwvQK9eA+/GVbexTQuczFlcY0tMwdVE23mxt7Q==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%b8%80%e6%b1%90" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl09_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl09$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl09_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#433576">#10楼</a><a name="433576" id="comment_anchor_433576"></a>2006-06-23 11:04 | <a id="Comments1_CommentList_ctl09_NameLink" href="http://www.cnblogs.com/tjxuemo/" target="_top">一汐</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%b8%80%e6%b1%90" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_433576" class="blog_comment_body">TerryLee
<br>
<br>你好，又来麻烦你了：）
<br>在“为一个已经存在的Blog增加多个Post”的代码中
<br>为何数据库中只增加了for循环的最后一条记录呢？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",433598,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(433598,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl10_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl10$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl10_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#433598">#11楼</a><a name="433598" id="comment_anchor_433598"></a>[<span class="louzhu">楼主</span>]2006-06-23 11:28 | <a id="Comments1_CommentList_ctl10_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_433598" class="blog_comment_body">@一汐
<br>把你的代码贴出来看一下吧，这样不好说是什么问题
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("一汐",433722,"hxSHKPBq4rNYJlC3gwvQK9eA+/GVbexTQuczFlcY0tMwdVE23mxt7Q==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(433722,"hxSHKPBq4rNYJlC3gwvQK9eA+/GVbexTQuczFlcY0tMwdVE23mxt7Q==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%b8%80%e6%b1%90" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl11_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl11$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl11_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#433722">#12楼</a><a name="433722" id="comment_anchor_433722"></a>2006-06-23 13:10 | <a id="Comments1_CommentList_ctl11_NameLink" href="http://www.cnblogs.com/tjxuemo/" target="_top">一汐</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%b8%80%e6%b1%90" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_433722" class="blog_comment_body">@TerryLee
<br>private void btnUpdate_Click(object sender, System.EventArgs e)
<br>		{
<br>			blog=Blog.Find(2);
<br>			using(TransactionScope tran = new TransactionScope())
<br>			{
<br>				try
<br>				{
<br>					blog.Name="Test";
<br>					for(int i=1;i&lt;6;i++)
<br>					{
<br>						post.Title="this is new Title!";
<br>						post.Contents="Contents"+i;
<br>						post.Category="Castle";
<br>						post.Blog=blog;
<br>						post.Save();
<br>					}
<br>					tran.VoteCommit();
<br>				}
<br>				catch
<br>				{
<br>					tran.VoteRollBack();
<br>				}
<br>			}
<br>		}
<br>这就是代码，是按你的示例代码写的
<br>还有就是你看这句：blog=Blog.Find(2);
<br>Find方法的参数只能是int的？
<br>如果我想查找string岂不是很不方便？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",434443,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(434443,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl12_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl12$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl12_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#434443">#13楼</a><a name="434443" id="comment_anchor_434443"></a>[<span class="louzhu">楼主</span>]2006-06-24 08:08 | <a id="Comments1_CommentList_ctl12_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_434443" class="blog_comment_body">@一汐
<br>这样看来没什么问题
<br>
<br>这样吧，你把完整的代码发到我邮箱里面，我看一下</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",436106,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(436106,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl13_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl13$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl13_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#436106">#14楼</a><a name="436106" id="comment_anchor_436106"></a>[<span class="louzhu">楼主</span>]2006-06-26 16:36 | <a id="Comments1_CommentList_ctl13_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_436106" class="blog_comment_body">@一汐
<br>问题出在了你把创建Post对象的代码放在了for循环的外面，这样每次循环所做的其实是同一个Post对象，把代码修改成如下这样即可：
<br>blog=Blog.Find(2);
<br>using(TransactionScope tran = new TransactionScope())
<br>{
<br>	try
<br>	{
<br>		blog.Name="Test";
<br>		blog.Author="TNSEB";
<br>		for(int i=1;i&lt;5;i++)
<br>		{
<br>			// 注意这儿
<br>                                      Post post = new Post();
<br>			post.Title="this is new Title!";
<br>			post.Contents="Contents"+i;
<br>			post.Category="Castle";
<br>			post.Blog=blog;
<br>			post.Save();
<br>		}
<br>		blog.Save();
<br>		tran.VoteCommit();
<br>	}
<br>	catch
<br>	{
<br>		tran.VoteRollBack();
<br>	}
<br>}</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("一汐",436116,"hxSHKPBq4rNYJlC3gwvQK9eA+/GVbexTQuczFlcY0tMwdVE23mxt7Q==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(436116,"hxSHKPBq4rNYJlC3gwvQK9eA+/GVbexTQuczFlcY0tMwdVE23mxt7Q==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%b8%80%e6%b1%90" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl14_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl14$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl14_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#436116">#15楼</a><a name="436116" id="comment_anchor_436116"></a>2006-06-26 16:47 | <a id="Comments1_CommentList_ctl14_NameLink" href="http://www.cnblogs.com/tjxuemo/" target="_top">一汐</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%b8%80%e6%b1%90" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_436116" class="blog_comment_body">@TerryLee
<br>
<br>呵呵，谢谢
<br>我知道了，问题的关键还不是blog.Save()的问题
<br>当然你说的也对，起初我是把这行代码放在了外边
<br>但是问题还是存在，我把它挪到了里边
<br>还是不行，就照你帮忙了
<br>
<br>其实关键的原因在于// 注意这儿 
<br>Post post = new Post(); 
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("一汐",436123,"hxSHKPBq4rNYJlC3gwvQK9eA+/GVbexTQuczFlcY0tMwdVE23mxt7Q==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(436123,"hxSHKPBq4rNYJlC3gwvQK9eA+/GVbexTQuczFlcY0tMwdVE23mxt7Q==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%b8%80%e6%b1%90" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl15_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl15$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl15_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#436123">#16楼</a><a name="436123" id="comment_anchor_436123"></a>2006-06-26 16:51 | <a id="Comments1_CommentList_ctl15_NameLink" href="http://www.cnblogs.com/tjxuemo/" target="_top">一汐</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%b8%80%e6%b1%90" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_436123" class="blog_comment_body">@TerryLee
<br>
<br>呵呵，谢谢
<br>我知道了，其实问题的关键还不是blog.Save()的问题
<br>当然你说的也对，起初我是把这行代码放在了外边
<br>但是问题还是存在，我把它挪到了里边
<br>还是不行，就照你帮忙了
<br>
<br>其实关键的原因在于
<br>               // 注意这儿 
<br>               Post post = new Post(); 
<br>这句
<br>我是直接把post设为全局变量了：protected Blog blog = new Blog();
<br>		              protected Post post = new Post();
<br>应该每次使用时new一下
<br>呵呵，多谢TerryLee百忙之中给与解答：）
<br>
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",436132,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(436132,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl16_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl16$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl16_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#436132">#17楼</a><a name="436132" id="comment_anchor_436132"></a>[<span class="louzhu">楼主</span>]2006-06-26 16:58 | <a id="Comments1_CommentList_ctl16_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_436132" class="blog_comment_body">@一汐
<br>嗯，问题就在那儿
<br>
<br>所以我给你写了一句：//注意这儿
<br>
<br>呵呵</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("microshot",463175,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(463175,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl17_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl17$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl17_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#463175">#18楼</a><a name="463175" id="comment_anchor_463175"></a>2006-07-30 09:13 | <a id="Comments1_CommentList_ctl17_NameLink" target="_blank">microshot[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_463175" class="blog_comment_body">@TerryLee
<br>post.Save()报错，而改成post.Create()就可以正常插入数据库了，这两个函数区别在于什么呢？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("microshot",463184,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(463184,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl18_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl18$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl18_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#463184">#19楼</a><a name="463184" id="comment_anchor_463184"></a>2006-07-30 09:42 | <a id="Comments1_CommentList_ctl18_NameLink" target="_blank">microshot[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_463184" class="blog_comment_body">@TerryLee
<br>不知道为何又可以了，怪事，原本直接复制你的代码
<br>catch 
<br>{ 
<br>tran.VoteRollBack(); 
<br>} 
<br>当发现没有插入数据的时候进行调试，发现Save()直接被catch捕获，然后就改了Create()试试，通过。接着再改为Save();
<br>并且改为
<br>catch(Castle.ActiveRecord.Framework.ActiveRecordException sx)
<br>{
<br>      System.Windows.Forms.MessageBox.Show(sx.Message);
<br>      tran.VoteRollBack();
<br>}
<br>居然正常了：(</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",463221,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(463221,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl19_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl19$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl19_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#463221">#20楼</a><a name="463221" id="comment_anchor_463221"></a>[<span class="louzhu">楼主</span>]2006-07-30 10:28 | <a id="Comments1_CommentList_ctl19_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_463221" class="blog_comment_body">@microshot
<br>
<br>这个不好说是什么原因，呵呵:-)</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("microshot",463233,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(463233,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl20_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl20$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl20_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#463233">#21楼</a><a name="463233" id="comment_anchor_463233"></a>2006-07-30 10:53 | <a id="Comments1_CommentList_ctl20_NameLink" target="_blank">microshot[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_463233" class="blog_comment_body">@TerryLee
<br>能解释一下Create() 和Save()的区别吗？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",463238,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(463238,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl21_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl21$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl21_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#463238">#22楼</a><a name="463238" id="comment_anchor_463238"></a>[<span class="louzhu">楼主</span>]2006-07-30 11:01 | <a id="Comments1_CommentList_ctl21_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_463238" class="blog_comment_body">@microshot
<br>在前面我说过，ActiveRecord底层封装的是NHibernate，而NHibernate中有Save()，Update()，SaveOrUpdate()几个方法，ActiveRecord是对这些方法作了一次封装。
<br>
<br>Create()执行的操作：
<br>----------------------------
<br>session.Save(instance);
<br>session.Flush();
<br>
<br>Save()执行的操作：
<br>-----------------------------
<br>session.SaveOrUpdate(instance);
<br>session.Flush();</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("microshot",463246,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(463246,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl22_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl22$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl22_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#463246">#23楼</a><a name="463246" id="comment_anchor_463246"></a>2006-07-30 11:15 | <a id="Comments1_CommentList_ctl22_NameLink" target="_blank">microshot[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_463246" class="blog_comment_body">@TerryLee
<br>哦，明白，刚才刚看了一下castle的源代码：） 3x</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",463261,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(463261,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl23_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl23$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl23_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#463261">#24楼</a><a name="463261" id="comment_anchor_463261"></a>[<span class="louzhu">楼主</span>]2006-07-30 11:45 | <a id="Comments1_CommentList_ctl23_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_463261" class="blog_comment_body">@microshot
<br>
<br>不用客气:-)</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("jojoke",467891,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(467891,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl24_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl24$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl24_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#467891">#25楼</a><a name="467891" id="comment_anchor_467891"></a>2006-08-04 16:24 | <a id="Comments1_CommentList_ctl24_NameLink" target="_blank">jojoke[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_467891" class="blog_comment_body">@TerryLee
<br>今天刚接触Castle，在你的讲解下觉得还不错，但是FindByPrimaryKey这个方法我怎么没有找到，我看了一下ActiveRecordBase里面没有这个方法，汗一下，我的Castle是从sourceforg下载过来的</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",467939,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(467939,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl25_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl25$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl25_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#467939">#26楼</a><a name="467939" id="comment_anchor_467939"></a>[<span class="louzhu">楼主</span>]2006-08-04 17:04 | <a id="Comments1_CommentList_ctl25_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_467939" class="blog_comment_body">@jojoke
<br>这个方法应该是2.0下的吧</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("jojoke",468068,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(468068,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl26_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl26$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl26_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#468068">#27楼</a><a name="468068" id="comment_anchor_468068"></a>2006-08-04 19:24 | <a id="Comments1_CommentList_ctl26_NameLink" target="_blank">jojoke[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_468068" class="blog_comment_body">@TerryLee 
<br>
<br>thanks
<br>是Castle2.0下的？ sorceforg不是最新的吗？
<br>我这里是.net frameword 2.0 的，怎么System.Transaction也没有呢
<br>奇怪</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("ditto",475355,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(475355,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl27_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl27$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl27_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#475355">#28楼</a><a name="475355" id="comment_anchor_475355"></a>2006-08-13 02:19 | <a id="Comments1_CommentList_ctl27_NameLink" target="_blank">ditto[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_475355" class="blog_comment_body">我的测试程序报这样一个错，麻烦TerryLee帮看下可能是什么原来造成的:
<br>CastleTest2.NTest.UserTest.DeleteTest : Castle.ActiveRecord.Framework.ActiveRecordException : Could not perform DeleteAll for User
<br>  ----&gt; NHibernate.ObjectDeletedException : deleted object would be re-saved by cascade (remove deleted object from associations): 2, of class: CastleTest2.User</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",476040,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(476040,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl28_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl28$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl28_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#476040">#29楼</a><a name="476040" id="comment_anchor_476040"></a>[<span class="louzhu">楼主</span>]2006-08-14 08:38 | <a id="Comments1_CommentList_ctl28_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_476040" class="blog_comment_body">@ditto
<br>你看一下Cascade设置的对不对？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("ditto",476883,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(476883,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl29_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl29$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl29_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#476883">#30楼</a><a name="476883" id="comment_anchor_476883"></a>2006-08-14 23:04 | <a id="Comments1_CommentList_ctl29_NameLink" target="_blank">ditto[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_476883" class="blog_comment_body">User类型这是这样设的
<br>        [BelongsTo(Column="Group_ID")]
<br>        public Group Group
<br>....
<br>
<br>Group类中我是这样设的
<br>
<br>     [HasMany(typeof(User), Table="Users", ColumnKey="Group_ID",Cascade=ManyRelationCascadeEnum.All)]
<br>        public System.Collections.IList Users
<br>.....
<br>
<br>这样有错吗?
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("ditto",476885,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(476885,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl30_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl30$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl30_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#476885">#31楼</a><a name="476885" id="comment_anchor_476885"></a>2006-08-14 23:12 | <a id="Comments1_CommentList_ctl30_NameLink" target="_blank">ditto[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_476885" class="blog_comment_body">Group类设成下面这个样子还是报一样的错:
<br>       [HasMany(typeof(User), Table="Users", ColumnKey="Group_ID",Cascade=ManyRelationCascadeEnum.AllDeleteOrphan)]
<br>        public System.Collections.IList Users
<br>
<br>Group类设成
<br>
<br>       [HasMany(typeof(User), Table="Users", ColumnKey="Group_ID)]
<br>        public System.Collections.IList Users
<br>
<br>的时候，不仅会报同样的错，而且不能执行了下代码:
<br>
<br>		Group grp=Group.Find(1);
<br>			User user2=new User();
<br>			user2.Name="XX";
<br>			user2.Sex="男";
<br>			user2.Age=28;
<br>//			user2.Save();  //这句注释掉了的，以测试级连更新
<br>			grp.Users=new ArrayList();
<br>			grp.Users.Add(user2);
<br>			grp.Update();
<br>
<br>
<br>
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("powerdel",483007,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(483007,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl31_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl31$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl31_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#483007">#32楼</a><a name="483007" id="comment_anchor_483007"></a>2006-08-22 10:00 | <a id="Comments1_CommentList_ctl31_NameLink" target="_blank">powerdel[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_483007" class="blog_comment_body">在one-many中,要通过主键删除many方的一个实体,该怎么办那.
<br>直接使用"快速入门"中的方法,提示"无法更新标识列",如果使用这里提供的方法,还有找到Many方在One的位置.不过我想应该可以直接删除的.CS文件是系统生成的,没有作修改.</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("powerdel",484296,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(484296,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl32_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl32$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl32_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#484296">#33楼</a><a name="484296" id="comment_anchor_484296"></a>2006-08-23 13:47 | <a id="Comments1_CommentList_ctl32_NameLink" target="_blank">powerdel[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_484296" class="blog_comment_body">呵呵,找到不能删除的原因了,原来是用工具生成的代码有错,修改后就好了.</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",484312,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(484312,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl33_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl33$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl33_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#484312">#34楼</a><a name="484312" id="comment_anchor_484312"></a>[<span class="louzhu">楼主</span>]2006-08-23 14:01 | <a id="Comments1_CommentList_ctl33_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_484312" class="blog_comment_body">@powerdel
<br>
<br>不好意思，最近太忙了
<br>
<br>一直没有顾得上回复！</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("doermlp",485783,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(485783,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl34_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl34$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl34_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#485783">#35楼</a><a name="485783" id="comment_anchor_485783"></a>2006-08-24 23:42 | <a id="Comments1_CommentList_ctl34_NameLink" target="_blank">doermlp[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_485783" class="blog_comment_body">把posts的外键设为不允许为空，级联删除时总是删不了，把外键改为允许为空就能删了，请问高手，这是怎么回事？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("小芒果先生",528239,"SJwZOoWJj3iiBoQM/wTXlH/r+wDpvKdHYLjf7qnVrdMJiw17XCqkVg==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(528239,"SJwZOoWJj3iiBoQM/wTXlH/r+wDpvKdHYLjf7qnVrdMJiw17XCqkVg==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e5%b0%8f%e8%8a%92%e6%9e%9c%e5%85%88%e7%94%9f" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl35_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl35$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl35_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#528239">#36楼</a><a name="528239" id="comment_anchor_528239"></a>2006-10-13 14:27 | <a id="Comments1_CommentList_ctl35_NameLink" href="http://www.cnblogs.com/fujianhua168/" target="_top">小芒果先生</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e5%b0%8f%e8%8a%92%e6%9e%9c%e5%85%88%e7%94%9f" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_528239" class="blog_comment_body">请问一下，XML配置方式 文件我已经生成好了。
<br> 我把它命名为Test.xml
<br>我现在想用Nuit来测试，应该怎么来配置。我的程序怎么知道我的配置文件是Test.xml????????
<br>先   谢谢</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",528850,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(528850,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl36_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl36$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl36_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#528850">#37楼</a><a name="528850" id="comment_anchor_528850"></a>[<span class="louzhu">楼主</span>]2006-10-14 11:48 | <a id="Comments1_CommentList_ctl36_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_528850" class="blog_comment_body">@小芒果先生
<br>如下：
<br>XmlConfigurationSource source = new XmlConfigurationSource("MyConfig.xml");
<br>
<br>参见：<a target="_new" href="http://terrylee.cnblogs.com/archive/2006/04/05/367381.html">http://terrylee.cnblogs.com/archive/2006/04/05/367381.html</a></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("wzj",538024,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(538024,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl37_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl37$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl37_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#538024">#38楼</a><a name="538024" id="comment_anchor_538024"></a>2006-10-24 10:00 | <a id="Comments1_CommentList_ctl37_NameLink" target="_blank">wzj[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_538024" class="blog_comment_body">public Post()
<br>
<br>    {
<br>
<br>        _created = DateTime.Now;
<br>
<br>    }</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",538300,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(538300,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl38_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl38$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl38_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#538300">#39楼</a><a name="538300" id="comment_anchor_538300"></a>[<span class="louzhu">楼主</span>]2006-10-24 13:01 | <a id="Comments1_CommentList_ctl38_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_538300" class="blog_comment_body">@wzj
<br>Post类里面有写啊</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("wrl",556340,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(556340,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl39_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl39$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl39_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#556340">#40楼</a><a name="556340" id="comment_anchor_556340"></a>2006-11-10 11:32 | <a id="Comments1_CommentList_ctl39_NameLink" target="_blank">wrl[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_556340" class="blog_comment_body">@powerdel
<br>我也遇到无法更新标识列的问题,不知道是哪里生成的有问题,楼主没说清楚啊.</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("paleyyang",558046,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(558046,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl40_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl40$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl40_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#558046">#41楼</a><a name="558046" id="comment_anchor_558046"></a>2006-11-12 00:29 | <a id="Comments1_CommentList_ctl40_NameLink" target="_blank">paleyyang[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_558046" class="blog_comment_body">You have accessed an ActiveRecord class that wasn't properly initialized. The only explanation is that the call to ActiveRecordStarter.Initialize() didn't include 一对多.Blog class 
<br>============
<br>嘛原因．．．</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("paleyyang",558052,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(558052,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl41_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl41$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl41_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#558052">#42楼</a><a name="558052" id="comment_anchor_558052"></a>2006-11-12 00:42 | <a id="Comments1_CommentList_ctl41_NameLink" target="_blank">paleyyang[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_558052" class="blog_comment_body">还有初始化的时候该怎么写呢？一个类的时候是这样．
<br>ActiveRecordStarter.Initialize(source,typeof(Post));
<br>
<br>两个类的时候是这样？？
<br>			ActiveRecordStarter.Initialize(source,typeof(Post));
<br>			ActiveRecordStarter.Initialize(source,typeof(Blog));</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",558421,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(558421,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl42_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl42$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl42_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#558421">#43楼</a><a name="558421" id="comment_anchor_558421"></a>[<span class="louzhu">楼主</span>]2006-11-12 17:07 | <a id="Comments1_CommentList_ctl42_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_558421" class="blog_comment_body">@paleyyang
<br>
<br>ActiveRecordStarter.Initialize(source,typeof(Post),typeof(Blog));</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("liubo",559796,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(559796,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl43_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl43$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl43_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#559796">#44楼</a><a name="559796" id="comment_anchor_559796"></a>2006-11-13 23:24 | <a id="Comments1_CommentList_ctl43_NameLink" target="_blank">liubo[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_559796" class="blog_comment_body">请教像这种父子关系结构如何映射：
<br>
<br>create table PropertyType (
<br>   TypeID               int                  primary key not null,
<br>   ParentTypeID         int                  foreign key references PropertyType(TypeID) null,
<br>   TypeName             varchar(200)         not null
<br>)
<br>
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",559920,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(559920,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl44_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl44$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl44_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#559920">#45楼</a><a name="559920" id="comment_anchor_559920"></a>[<span class="louzhu">楼主</span>]2006-11-14 08:43 | <a id="Comments1_CommentList_ctl44_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_559920" class="blog_comment_body">@liubo
<br>典型的一对多啊，跟文章中的Blog和Post的关系一样，还是用HasMany和BelongsTo特性</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("liubo",560135,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(560135,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl45_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl45$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl45_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#560135">#46楼</a><a name="560135" id="comment_anchor_560135"></a>2006-11-14 11:09 | <a id="Comments1_CommentList_ctl45_NameLink" target="_blank">liubo[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_560135" class="blog_comment_body">可是报错啊，请再帮我看看：
<br>	[ActiveRecord("PropertyType")]
<br>	public class PropertyType:ActiveRecordBase
<br>	{
<br>		private int typeid;
<br>		private string typename;
<br>		private PropertyType parenttype;
<br>
<br>		[PrimaryKey(PrimaryKeyType.Identity,"typeid")]
<br>		public int TypeID
<br>		{
<br>			get {return typeid;}
<br>			set {typeid=value;}
<br>		}
<br>
<br>		[Property("typename")]
<br>		public string TypeName
<br>		{
<br>			get {return typename;}
<br>			set {typename=value;}
<br>		}
<br>
<br>		[HasMany(typeof(PropertyType),"typeid","propertytype")]
<br>		public PropertyType ParentType
<br>		{
<br>			get {return parenttype;}
<br>			set {parenttype=value;}
<br>		}
<br>	}
<br>
<br>错误信息如下：Could not guess relation type for property PropertyType.ParentType .</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("liubo",560151,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(560151,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl46_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl46$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl46_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#560151">#47楼</a><a name="560151" id="comment_anchor_560151"></a>2006-11-14 11:21 | <a id="Comments1_CommentList_ctl46_NameLink" target="_blank">liubo[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_560151" class="blog_comment_body">OK啦，这里应该用BelongsTo特性！
<br>
<br>：）</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("TerryLee",560956,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(560956,"K82dKaku/JiNNC/PeczvjL4gReWZAaP9pFNyUxpHUmhQUsdw4bZYEA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=TerryLee" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl47_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl47$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl47_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#560956">#48楼</a><a name="560956" id="comment_anchor_560956"></a>[<span class="louzhu">楼主</span>]2006-11-15 12:53 | <a id="Comments1_CommentList_ctl47_NameLink" href="http://www.cnblogs.com/Terrylee/" target="_top">TerryLee</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/TerryLee" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_560956" class="blog_comment_body">@liubo
<br>:)</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("ni",639804,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(639804,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl48_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl48$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl48_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#639804">#49楼</a><a name="639804" id="comment_anchor_639804"></a>2007-02-04 21:52 | <a id="Comments1_CommentList_ctl48_NameLink" target="_blank">ni[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_639804" class="blog_comment_body">各位大侠：
<br>    我在测试 TestCascadingSave() 方法时有以下错误，代码都是在此页面Copy的 。求教了！
<br>
<br>"You have accessed an ActiveRecord class that wasn't properly initialized. The only explanation is that the call to ActiveRecordStarter.Initialize() didn't include OneManyTest.Blog class"}	System.Exception {Castle.ActiveRecord.Framework.ActiveRecordException}
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("mingxingw",773237,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(773237,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl49_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl49$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl49_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#773237">#50楼</a><a name="773237" id="comment_anchor_773237"></a>2007-06-06 10:55 | <a id="Comments1_CommentList_ctl49_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://mingxing_84@163.com" target="_top">mingxingw[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_773237" class="blog_comment_body">抛出异常说：Hibernate.dialect的属性没有设置，可是我的配置文件里卖时设置了的啊！</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("mingxingw",773269,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(773269,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl50_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl50$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl50_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#773269">#51楼</a><a name="773269" id="comment_anchor_773269"></a>2007-06-06 11:12 | <a id="Comments1_CommentList_ctl50_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://mingxing_84@163.com" target="_top">mingxingw[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_773269" class="blog_comment_body">@ni
<br>
<br>我也遇到这个问题呢！还不知道是怎么回事呢！
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("handianyixin",773303,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(773303,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl51_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl51$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl51_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#773303">#52楼</a><a name="773303" id="comment_anchor_773303"></a>2007-06-06 11:26 | <a id="Comments1_CommentList_ctl51_NameLink" target="_blank">handianyixin[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_773303" class="blog_comment_body">You have accessed an ActiveRecord class that wasn't properly initialized. The only explanation is that the call to ActiveRecordStarter.Initialize() didn't include Blog class
<br>报这个异常是什么原因呀?恳请大家帮帮忙呀!</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("mingxingw",773323,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(773323,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl52_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl52$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl52_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#773323">#53楼</a><a name="773323" id="comment_anchor_773323"></a>2007-06-06 11:40 | <a id="Comments1_CommentList_ctl52_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://mingxing_84@163.com" target="_top">mingxingw[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_773323" class="blog_comment_body">@paleyyang
<br>
<br>你好！我也出现了这个问题！请问你是怎么解决的呢！
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("mingxingw",773328,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(773328,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl53_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl53$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl53_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#773328">#54楼</a><a name="773328" id="comment_anchor_773328"></a>2007-06-06 11:41 | <a id="Comments1_CommentList_ctl53_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://mingxing_84@163.com" target="_top">mingxingw[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_773328" class="blog_comment_body">@ni
<br>这个是什么原因呢！我也想弄清楚呢！</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("handianyixin",773455,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(773455,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl54_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl54$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl54_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#773455">#55楼</a><a name="773455" id="comment_anchor_773455"></a>2007-06-06 13:23 | <a id="Comments1_CommentList_ctl54_NameLink" target="_blank">handianyixin[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_773455" class="blog_comment_body">SQL Server2000和SQL Server2005,
<br>Hibernate.dialect的属性设置是不是一样的呀?
<br>是不是都是NHibernate.Dialect.MsSql2000Dialect这个呀?
<br>它和.NET是2.0还是1.0有没有关系呀?到现在还没有写一个成功的例子出,
<br>郁闷呀!请各位帮帮忙了,感激不尽!</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("orafan",785569,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(785569,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl55_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl55$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl55_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#785569">#56楼</a><a name="785569" id="comment_anchor_785569"></a>2007-06-16 11:29 | <a id="Comments1_CommentList_ctl55_NameLink" target="_blank">orafan[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_785569" class="blog_comment_body">请教一个问题：
<br>假如blog类和post类分别在程序集A和程序集B中，程序集B依赖于程序集A，但程序集A不能依赖于程序集B，即post知道有blog，但blog不知道有post，在此前提下如何实现post的O-R Mapping？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("orafan",786298,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(786298,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl56_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl56$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl56_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#786298">#57楼</a><a name="786298" id="comment_anchor_786298"></a>2007-06-17 11:10 | <a id="Comments1_CommentList_ctl56_NameLink" target="_blank">orafan[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_786298" class="blog_comment_body">@orafan
<br>ok了！
<br>用JoinedKey代替BelongTo</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("ttl",882004,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(882004,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl57_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl57$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl57_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#882004">#58楼</a><a name="882004" id="comment_anchor_882004"></a>2007-09-04 22:16 | <a id="Comments1_CommentList_ctl57_NameLink" target="_blank">ttl[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_882004" class="blog_comment_body">顶 顶 顶 </span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Jame.Wang",903592,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(903592,"")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl58_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl58$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl58_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#903592">#59楼</a><a name="903592" id="comment_anchor_903592"></a>2007-09-23 22:45 | <a id="Comments1_CommentList_ctl58_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://asdf" target="_top">Jame.Wang[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_903592" class="blog_comment_body">one to one 怎么用的哦!可以用到一对多不哦!</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("小小兵",964943,"9Uv6ulUsK/s9QD0eQaDnOsiqsPutKVle1+BXeOohRCckR1ptOzPUIA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(964943,"9Uv6ulUsK/s9QD0eQaDnOsiqsPutKVle1+BXeOohRCckR1ptOzPUIA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e5%b0%8f%e5%b0%8f%e5%85%b5" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl59_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl59$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl59_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#964943">#60楼</a><a name="964943" id="comment_anchor_964943"></a>2007-11-19 23:25 | <a id="Comments1_CommentList_ctl59_NameLink" href="http://www.cnblogs.com/wxpwdm8461/" target="_top">小小兵</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e5%b0%8f%e5%b0%8f%e5%85%b5" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_964943" class="blog_comment_body">我用这个代码有个示例public class Blog : ActiveRecordBase
<br>{    private int _id;
<br>    private String _name;
<br>    private String _author;
<br>    private IList _posts;//这个地方有错，ILIST少一个参数，但你就是这么写的为么不对呢！？？？
<br>    [PrimaryKey(PrimaryKeyType.Native, "blog_id")]
<br>    public int Id
<br>
<br>    {
<br>
<br>        get { return _id; }
<br>
<br>        set { _id = value; }
<br>
<br>    }
<br>
<br> 
<br>
<br>    [Property("blog_name")]
<br>
<br>    public String Name
<br>
<br>    {
<br>
<br>        get { return _name; }
<br>
<br>        set { _name = value; }
<br>
<br>    }
<br>
<br> 
<br>
<br>    [Property("blog_author")]
<br>
<br>    public String Author
<br>
<br>    {
<br>
<br>        get { return _author; }
<br>
<br>        set { _author = value; }
<br>
<br>    }
<br>
<br>    
<br>
<br>    [HasMany(typeof(Post), Table="posts", ColumnKey="post_blogid")]
<br>
<br>    public IList Posts／／这个地方也是，ILIST少一个参数，但你就是这么写的为么不对呢！？？？
<br>
<br>    {
<br>
<br>        get { return _posts; }
<br>
<br>        set { _posts = value; }
<br>
<br>    }
<br>
<br>麻烦再说清楚一点</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Todd C",1380613,"Wr+qpj/EhmuKYdq9hDQS4SdhudS/KpY70EY+pfmIf7UFEbuIgXYmcA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1380613,"Wr+qpj/EhmuKYdq9hDQS4SdhudS/KpY70EY+pfmIf7UFEbuIgXYmcA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Todd+C" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl60_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl60$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl60_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1380613">#61楼</a><a name="1380613" id="comment_anchor_1380613"></a>2008-11-24 22:14 | <a id="Comments1_CommentList_ctl60_NameLink" href="http://www.cnblogs.com/Cyto/" target="_top">Todd C</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Todd+C" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1380613" class="blog_comment_body">这里的两张表在数据库里建了外键关系，我尝试把这个外键关系删掉，然后运行测试，发现post_blogid里还是填入了blog_id的值，我就奇怪了，castle就怎么确定我的所想要的一对多指的是blog_id&lt;=post_blogid,在以上的代码中无论是HasMary还是BelongsTo都只指明了post_blogid，castle是默认将post_blogid与主键对应吗？在一些其它的场合，如果我们的需求怪异一点话，我希望将post_blogid与Blog的其它字段建立一对多的关系又怎么实现呢？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Todd C",1380633,"Wr+qpj/EhmuKYdq9hDQS4SdhudS/KpY70EY+pfmIf7UFEbuIgXYmcA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1380633,"Wr+qpj/EhmuKYdq9hDQS4SdhudS/KpY70EY+pfmIf7UFEbuIgXYmcA==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Todd+C" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl61_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl61$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl61_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1380633">#62楼</a><a name="1380633" id="comment_anchor_1380633"></a>2008-11-24 22:28 | <a id="Comments1_CommentList_ctl61_NameLink" href="http://www.cnblogs.com/Cyto/" target="_top">Todd C</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Todd+C" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1380633" class="blog_comment_body">刚才有个网友说他们公司一般不会使用HasMary或BelongsTo特性到Model中，表间关系都是自己控制，您觉得这样做可行吗？</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("别爱上哥，哥只是个传说！",1648720,"Am7dGpw7yAhxuAnRwsEAYg4ryxyagQFHTi+ObIFwbWHJHi/Fkwvh7A==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1648720,"Am7dGpw7yAhxuAnRwsEAYg4ryxyagQFHTi+ObIFwbWHJHi/Fkwvh7A==")' href="http://terrylee.cnblogs.com/archive/2006/04/06/368471.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e5%88%ab%e7%88%b1%e4%b8%8a%e5%93%a5%ef%bc%8c%e5%93%a5%e5%8f%aa%e6%98%af%e4%b8%aa%e4%bc%a0%e8%af%b4%ef%bc%81" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl62_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl62$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl62_EditLink" causesvalidation="False"></a>
				</div>
				<a href="#1648720">#63楼</a><a name="1648720" id="comment_anchor_1648720"></a><a name="Post"></a>2009-09-16 15:34 | <a id="Comments1_CommentList_ctl62_NameLink" href="http://www.cnblogs.com/fit/" target="_top">别爱上哥，哥只是个传说！</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e5%88%ab%e7%88%b1%e4%b8%8a%e5%93%a5%ef%bc%8c%e5%93%a5%e5%8f%aa%e6%98%af%e4%b8%aa%e4%bc%a0%e8%af%b4%ef%bc%81" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1648720" class="blog_comment_body">发现楼主已经一年没有更新blog了!</span><br>
			</div>
		</div>
	

<div id="ctl05_comment_form" class="commentform">




<div id="ctl05_divLoginPannel">
<div class="login_tips">注册用户登录后才能发表评论，请 <a href="http://passport.cnblogs.com/login.aspx?ReturnUrl=http%3a%2f%2fterrylee.cnblogs.com%2farchive%2f2006%2f04%2f06%2f368471.html%3flogin%3d1%23commentform" class="underline">登录</a> 或 <a href="http://passport.cnblogs.com/register.aspx?ReturnUrl=http%3a%2f%2fterrylee.cnblogs.com%2farchive%2f2006%2f04%2f06%2f368471.html%23Bottom2" class="underline">注册</a> 。</div>
</div>

<div class="itnews c_ad_block" id="itnews">
<a href="http://news.cnblogs.com/" target="_top">IT新闻</a>:<br>

          ·  <a href="http://news.cnblogs.com/n/55114/" target="_top">谷歌联手亚马逊在英国推出Android音乐商店</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55112/" target="_top">Facebook成为Apache软件基金会黄金赞助商</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55111/" target="_top">IBM荣获2009年美国专利申请冠军</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55100/" target="_top">麦当劳美国餐馆Wi-Fi服务全面免费</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55097/" target="_top">Java SE 6更新，性能大幅提升</a><br>
	
</div>


<div id="ad_under_comment" class="c_ad_block">
<a href="http://a4.yeshj.com/rd/34138/" target="_top">每天10分钟，轻松学英语</a><br><br>
<div id="google_ads_div_cnblogs_blogpost_bottom1">
<iframe src="index_1.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom1" id="google_ads_iframe_cnblogs_blogpost_bottom1" scrolling="no" frameborder="0" height="60" width="468"></iframe></div>

<br>
<div id="google_ads_div_cnblogs_blogpost_bottom">
<iframe src="index_2.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom" id="google_ads_iframe_cnblogs_blogpost_bottom" scrolling="no" frameborder="0" height="250" width="300"></iframe></div>

</div>
<div id="site_nav_under" class="c_ad_block">
网站导航：<br>
<a href="http://www.cnblogs.com/" target="_top">博客园首页</a> &nbsp;<a href="http://news.cnblogs.com/" target="_top">IT新闻</a> &nbsp;<a href="http://home.cnblogs.com/" target="_top">个人主页</a> &nbsp;<a href="http://home.cnblogs.com/ing/" target="_top">闪存</a> &nbsp;<a href="http://job.cnblogs.com/" target="_top">程序员招聘</a> &nbsp;<a href="http://space.cnblogs.com/" target="_top">社区</a> &nbsp;<a href="http://space.cnblogs.com/q/" target="_top">博问</a> &nbsp;<a href="http://wz.cnblogs.com/" target="_top">网摘</a>
</div>
<div id="ad_under_comment2" class="c_ad_block">
<a href="http://www.china-pub.com/STATIC07/0912/zh_ndcx_091212.asp" target="_top"><img src="chinapub_20091222.jpg" alt="" style="border: 0px none ;"></a><br>
<a href="http://www.china-pub.com/itbook/" target="_top">China-pub 计算机图书网上专卖店！6.5万品种2-8折！</a><br>
<a href="http://www.china-pub.com/static07/0901/zh_jueba_090121.asp" target="_top">China-Pub 计算机绝版图书按需印刷服务</a><br>
</div>

<div id="relative_search"><br><b>相关搜索:</b><br> <a href="http://zzk.cnblogs.com/s?w=%5b11%5d%e6%95%b0%e6%8d%ae%e6%8c%81%e4%b9%85" target="_top">[11]数据持久</a> <a href="http://zzk.cnblogs.com/s?w=%5b12%5d%e5%bc%80%e6%ba%90%e4%b8%96%e7%95%8c" target="_top">[12]开源世界</a> </div><div id="relative_search"><br><b>在知识库中查看：</b><br> <a href="http://kb.cnblogs.com/a/368471/">Castle ActiveRecord学习实践（4）：实现One-Many关系的映射</a></div>

</div>


				
	</div><!--end: forFlow -->
	</div><!--end: mainContent 主体内容容器-->

	<div id="sideBar">
		<div id="sideBarMain">
			
<!--done-->
<div class="newsItem">
<h3 class="catListTitle">公告</h3>
	<div class="box">
<h3 class="boxtitle">个人简介</h3>
<ul>
    <li><img src="o_terrylee.png" alt=""></li>
    <li>网名：TerryLee</li>
    <li>本名：李会军</li>
    <li>位置：中国 北京</li>
    <li>请大家发邮件至</li>
    <li><img src="o_terrylee_cnblogs.png" alt="TerryLee"></li>
   </ul>
</div>
<div class="box">
<h3 class="boxtitle">关注我</h3>
<a href="http://twitter.com/TerryLeeTech"><img src="followme.png" alt="在Twitter上关注我" style="margin-left: 5px;"></a>
<a href="http://www.dotneteye.cn/blog/syndication.axd"><img src="feedadd.png" alt="订阅我的Blog" style="margin-left: 15px;"></a>
</div>
<div class="box">
<h3 class="boxtitle">我的著作</h3>
<ul>
    <li><img alt="" src="o_silverlight02.jpg" border="0"></li>
    <li>官网：<a href="http://www.dotneteye.cn/silverlight">《Silverlight 2完美征程》</a></li>
</ul>
</div>
<div class="box">
<h3 class="boxtitle">我在说</h3>
<ul id="twitter_update_list"></ul>
<a href="http://twitter.com/TerryLeeTech" id="twitter-link" style="display: block; text-align: right;">follow me on Twitter</a>
</div>
<div class="box">
<h3 class="boxtitle">MVP配置</h3>
<ul>
    <li><img alt="" src="o_o_mvp_horizontal_fullcolor_182_74.png" border="0"></li>
    <li><a href="https://mvp.support.microsoft.com/profile=8FECB25C-0CBC-432F-9F25-E2698DDF3CA1">MVP配置</a></li>
</ul>
</div>
<div class="box">
<h3 class="boxtitle">个人主页</h3>
<ul>
<li>
<a href="http://www.dotneteye.cn/"><img src="o_dotnet.png" alt=""></a>
</li>
</ul>
</div>
<div class="box">
<h3 class="boxtitle">版权声明</h3>
    <ul>
        <li>本站采用<a href="http://creativecommons.org/licenses/by-nc/2.5/" target="_top" rel="license">创作共用</a>许可
        署名，非商业
<a href="http://www.51.la/?00260513" target="_top"><img alt="51.la 专业、免费、强健的访问统计" src="icon_8.gif" style="border: medium none ;"></a>
<img style="width: 0px; height: 0px;" src="go.asp">
        </li></ul>
    </div>
<div class="box">
<h3 class="boxtitle">绿色通道</h3>
  <ul>
   <li>1.<a href="http://www.cnblogs.com/Terrylee/archive/2008/03/09/Silverlight2-step-by-step-Tutorials.html">一步一步学Silverlight 2系列</a></li>
<li>2.<a href="http://www.cnblogs.com/Terrylee/archive/2006/07/17/334911.html">.NET设计模式系列文章</a></li>
<li>3.<a href="http://www.cnblogs.com/Terrylee/archive/2006/11/12/558683.html">ASP.NET AJAX入门系列</a></li>
<li>4.<a href="http://www.cnblogs.com/Terrylee/archive/2006/04/28/387503.html">Castle开发系列文章</a></li>
<li>5.<a href="http://www.cnblogs.com/Terrylee/archive/2006/08/01/464591.html">Enterprise Library系列</a></li>
<li><a href="http://dotnet.cnblogs.com/">博客园.NET频道</a></li>
  </ul>
</div><div id="profile_block"><a href="http://home.cnblogs.com/Terrylee/" target="_top">我的主页</a>&nbsp; <a href="http://home.cnblogs.com/Terrylee/detail/" target="_top">个人资料</a><br><a href="http://home.cnblogs.com/Terrylee/ing/" target="_top">我的闪存</a>&nbsp; <a href="http://space.cnblogs.com/msg/send/TerryLee" target="_top">发短消息</a></div>
</div>

			
			
			<div id="leftcontentcontainer">
				

<div class="mySearch">
<h3 class="catListTitle">搜索</h3>
<div class="div_my_zzk"><input value="" id="q" onkeydown="return zzk_go_enter(event);" class="input_my_zzk" type="text">&nbsp;<input onclick="zzk_go()" value="找找看" id="btnZzk" class="btn_my_zzk" type="button"></div>
</div>
<div class="catListPostCategory">
<h3 class="catListTitle">随笔分类</h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_Link" href="http://www.cnblogs.com/Terrylee/category/48779.html">[01]&nbsp;&nbsp;.NET大本营(50)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_RssLink" title="Subscribe to [01]&amp;nbsp;&amp;nbsp;.NET大本营(50)" href="http://www.cnblogs.com/Terrylee/category/48779.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_Link" href="http://www.cnblogs.com/Terrylee/category/161309.html">[02]&nbsp;&nbsp;探微知著CLR</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_RssLink" title="Subscribe to [02]&amp;nbsp;&amp;nbsp;探微知著CLR" href="http://www.cnblogs.com/Terrylee/category/161309.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_Link" href="http://www.cnblogs.com/Terrylee/category/78190.html">[03]&nbsp;&nbsp;银光点亮世界(62)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_RssLink" title="Subscribe to [03]&amp;nbsp;&amp;nbsp;银光点亮世界(62)" href="http://www.cnblogs.com/Terrylee/category/78190.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_Link" href="http://www.cnblogs.com/Terrylee/category/36734.html">[04]&nbsp;&nbsp;WCF后传(17)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_RssLink" title="Subscribe to [04]&amp;nbsp;&amp;nbsp;WCF后传(17)" href="http://www.cnblogs.com/Terrylee/category/36734.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_Link" href="http://www.cnblogs.com/Terrylee/category/36516.html">[05]&nbsp;&nbsp;架构与设计(24)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_RssLink" title="Subscribe to [05]&amp;nbsp;&amp;nbsp;架构与设计(24)" href="http://www.cnblogs.com/Terrylee/category/36516.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_Link" href="http://www.cnblogs.com/Terrylee/category/48778.html">[06]&nbsp;&nbsp;LINQ之美(4)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_RssLink" title="Subscribe to [06]&amp;nbsp;&amp;nbsp;LINQ之美(4)" href="http://www.cnblogs.com/Terrylee/category/48778.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_Link" href="http://www.cnblogs.com/Terrylee/category/115628.html">[07]&nbsp;&nbsp;AJAX风云(15)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_RssLink" title="Subscribe to [07]&amp;nbsp;&amp;nbsp;AJAX风云(15)" href="http://www.cnblogs.com/Terrylee/category/115628.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_Link" href="http://www.cnblogs.com/Terrylee/category/37512.html">[08]&nbsp;&nbsp;Web开发(66)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_RssLink" title="Subscribe to [08]&amp;nbsp;&amp;nbsp;Web开发(66)" href="http://www.cnblogs.com/Terrylee/category/37512.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl09_Link" href="http://www.cnblogs.com/Terrylee/category/124829.html">[09]&nbsp;&nbsp;依赖注入(14)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl09_RssLink" title="Subscribe to [09]&amp;nbsp;&amp;nbsp;依赖注入(14)" href="http://www.cnblogs.com/Terrylee/category/124829.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl10_Link" href="http://www.cnblogs.com/Terrylee/category/36514.html">[10]&nbsp;&nbsp;模式与实践(68)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl10_RssLink" title="Subscribe to [10]&amp;nbsp;&amp;nbsp;模式与实践(68)" href="http://www.cnblogs.com/Terrylee/category/36514.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl11_Link" href="http://www.cnblogs.com/Terrylee/category/48535.html">[11]&nbsp;&nbsp;数据持久(19)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl11_RssLink" title="Subscribe to [11]&amp;nbsp;&amp;nbsp;数据持久(19)" href="http://www.cnblogs.com/Terrylee/category/48535.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl12_Link" href="http://www.cnblogs.com/Terrylee/category/53293.html">[12]&nbsp;&nbsp;开源世界(35)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl12_RssLink" title="Subscribe to [12]&amp;nbsp;&amp;nbsp;开源世界(35)" href="http://www.cnblogs.com/Terrylee/category/53293.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl13_Link" href="http://www.cnblogs.com/Terrylee/category/44974.html">[13]&nbsp;&nbsp;代码生成(23)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl13_RssLink" title="Subscribe to [13]&amp;nbsp;&amp;nbsp;代码生成(23)" href="http://www.cnblogs.com/Terrylee/category/44974.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl14_Link" href="http://www.cnblogs.com/Terrylee/category/48958.html">[14]&nbsp;&nbsp;测试与重构(3)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl14_RssLink" title="Subscribe to [14]&amp;nbsp;&amp;nbsp;测试与重构(3)" href="http://www.cnblogs.com/Terrylee/category/48958.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl15_Link" href="http://www.cnblogs.com/Terrylee/category/124830.html">[15]&nbsp;&nbsp;工作流基础</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl15_RssLink" title="Subscribe to [15]&amp;nbsp;&amp;nbsp;工作流基础" href="http://www.cnblogs.com/Terrylee/category/124830.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl16_Link" href="http://www.cnblogs.com/Terrylee/category/162553.html">[16]&nbsp;&nbsp;技术曲苑杂坛(1)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl16_RssLink" title="Subscribe to [16]&amp;nbsp;&amp;nbsp;技术曲苑杂坛(1)" href="http://www.cnblogs.com/Terrylee/category/162553.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl17_Link" href="http://www.cnblogs.com/Terrylee/category/160783.html">[17]&nbsp;&nbsp;并行编程(1)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl17_RssLink" title="Subscribe to [17]&amp;nbsp;&amp;nbsp;并行编程(1)" href="http://www.cnblogs.com/Terrylee/category/160783.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl18_Link" href="http://www.cnblogs.com/Terrylee/category/58451.html">[18]&nbsp;&nbsp;动态语言(4)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl18_RssLink" title="Subscribe to [18]&amp;nbsp;&amp;nbsp;动态语言(4)" href="http://www.cnblogs.com/Terrylee/category/58451.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl19_Link" href="http://www.cnblogs.com/Terrylee/category/187123.html">[19] 写作生涯(2)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl19_RssLink" title="Subscribe to [19] 写作生涯(2)" href="http://www.cnblogs.com/Terrylee/category/187123.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl20_Link" href="http://www.cnblogs.com/Terrylee/category/36735.html">[20]&nbsp;&nbsp;推荐系列(32)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl20_RssLink" title="Subscribe to [20]&amp;nbsp;&amp;nbsp;推荐系列(32)" href="http://www.cnblogs.com/Terrylee/category/36735.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl21_Link" href="http://www.cnblogs.com/Terrylee/category/36515.html">[21]&nbsp;&nbsp;数据库相关(18)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl21_RssLink" title="Subscribe to [21]&amp;nbsp;&amp;nbsp;数据库相关(18)" href="http://www.cnblogs.com/Terrylee/category/36515.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl22_Link" href="http://www.cnblogs.com/Terrylee/category/43288.html">[30]&nbsp;&nbsp;前沿报道(28)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl22_RssLink" title="Subscribe to [30]&amp;nbsp;&amp;nbsp;前沿报道(28)" href="http://www.cnblogs.com/Terrylee/category/43288.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl23_Link" href="http://www.cnblogs.com/Terrylee/category/36511.html">[31]&nbsp;&nbsp;项目管理(3)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl23_RssLink" title="Subscribe to [31]&amp;nbsp;&amp;nbsp;项目管理(3)" href="http://www.cnblogs.com/Terrylee/category/36511.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl24_Link" href="http://www.cnblogs.com/Terrylee/category/148211.html">[32]&nbsp;&nbsp;我点我评(2)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl24_RssLink" title="Subscribe to [32]&amp;nbsp;&amp;nbsp;我点我评(2)" href="http://www.cnblogs.com/Terrylee/category/148211.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl25_Link" href="http://www.cnblogs.com/Terrylee/category/51852.html">[33]&nbsp;&nbsp;我思我考(13)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl25_RssLink" title="Subscribe to [33]&amp;nbsp;&amp;nbsp;我思我考(13)" href="http://www.cnblogs.com/Terrylee/category/51852.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl26_Link" href="http://www.cnblogs.com/Terrylee/category/51900.html">[34]&nbsp;&nbsp;社区活动(9)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl26_RssLink" title="Subscribe to [34]&amp;nbsp;&amp;nbsp;社区活动(9)" href="http://www.cnblogs.com/Terrylee/category/51900.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl27_Link" href="http://www.cnblogs.com/Terrylee/category/36507.html">[35]&nbsp;&nbsp;东拉西扯(37)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl27_RssLink" title="Subscribe to [35]&amp;nbsp;&amp;nbsp;东拉西扯(37)" href="http://www.cnblogs.com/Terrylee/category/36507.html/rss">(rss)</a></li>

</ul>

</div>

<div class="catListPostArchive">
<h3 class="catListTitle">随笔档案</h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl01_Link" href="http://www.cnblogs.com/Terrylee/archive/2009/08.html">2009年8月 (1)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl02_Link" href="http://www.cnblogs.com/Terrylee/archive/2009/05.html">2009年5月 (1)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl03_Link" href="http://www.cnblogs.com/Terrylee/archive/2009/04.html">2009年4月 (3)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl04_Link" href="http://www.cnblogs.com/Terrylee/archive/2009/01.html">2009年1月 (2)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl05_Link" href="http://www.cnblogs.com/Terrylee/archive/2008/12.html">2008年12月 (4)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl06_Link" href="http://www.cnblogs.com/Terrylee/archive/2008/11.html">2008年11月 (10)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl07_Link" href="http://www.cnblogs.com/Terrylee/archive/2008/10.html">2008年10月 (12)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl08_Link" href="http://www.cnblogs.com/Terrylee/archive/2008/09.html">2008年9月 (3)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl09_Link" href="http://www.cnblogs.com/Terrylee/archive/2008/08.html">2008年8月 (5)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl10_Link" href="http://www.cnblogs.com/Terrylee/archive/2008/07.html">2008年7月 (13)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl11_Link" href="http://www.cnblogs.com/Terrylee/archive/2008/06.html">2008年6月 (10)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl12_Link" href="http://www.cnblogs.com/Terrylee/archive/2008/03.html">2008年3月 (41)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl13_Link" href="http://www.cnblogs.com/Terrylee/archive/2008/02.html">2008年2月 (5)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl14_Link" href="http://www.cnblogs.com/Terrylee/archive/2008/01.html">2008年1月 (13)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl15_Link" href="http://www.cnblogs.com/Terrylee/archive/2007/12.html">2007年12月 (15)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl16_Link" href="http://www.cnblogs.com/Terrylee/archive/2007/11.html">2007年11月 (7)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl17_Link" href="http://www.cnblogs.com/Terrylee/archive/2007/07.html">2007年7月 (3)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl18_Link" href="http://www.cnblogs.com/Terrylee/archive/2007/04.html">2007年4月 (2)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl19_Link" href="http://www.cnblogs.com/Terrylee/archive/2007/03.html">2007年3月 (4)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl20_Link" href="http://www.cnblogs.com/Terrylee/archive/2007/02.html">2007年2月 (2)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl21_Link" href="http://www.cnblogs.com/Terrylee/archive/2007/01.html">2007年1月 (6)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl22_Link" href="http://www.cnblogs.com/Terrylee/archive/2006/12.html">2006年12月 (18)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl23_Link" href="http://www.cnblogs.com/Terrylee/archive/2006/11.html">2006年11月 (32)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl24_Link" href="http://www.cnblogs.com/Terrylee/archive/2006/10.html">2006年10月 (35)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl25_Link" href="http://www.cnblogs.com/Terrylee/archive/2006/09.html">2006年9月 (19)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl26_Link" href="http://www.cnblogs.com/Terrylee/archive/2006/08.html">2006年8月 (16)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl27_Link" href="http://www.cnblogs.com/Terrylee/archive/2006/07.html">2006年7月 (23)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl28_Link" href="http://www.cnblogs.com/Terrylee/archive/2006/06.html">2006年6月 (11)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl29_Link" href="http://www.cnblogs.com/Terrylee/archive/2006/05.html">2006年5月 (13)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl30_Link" href="http://www.cnblogs.com/Terrylee/archive/2006/04.html">2006年4月 (24)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl31_Link" href="http://www.cnblogs.com/Terrylee/archive/2006/03.html">2006年3月 (17)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl32_Link" href="http://www.cnblogs.com/Terrylee/archive/2006/02.html">2006年2月 (13)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl33_Link" href="http://www.cnblogs.com/Terrylee/archive/2006/01.html">2006年1月 (13)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl34_Link" href="http://www.cnblogs.com/Terrylee/archive/2005/12.html">2005年12月 (38)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl35_Link" href="http://www.cnblogs.com/Terrylee/archive/2005/11.html">2005年11月 (20)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl36_Link" href="http://www.cnblogs.com/Terrylee/archive/2005/10.html">2005年10月 (27)</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl37_Link" href="http://www.cnblogs.com/Terrylee/archive/2005/09.html">2005年9月 (10)</a> </li>

</ul>

</div>

<div class="catList">
<h3 class="catListTitle">个人站点</h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl01_Link" href="http://terrylee.blog.51cto.com/" target="_top">TerryLee @ 51CTO</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl01_RssLink" title="Subscribe to TerryLee @ 51CTO" href="http://terrylee.blog.51cto.com/">(rss)</a></li>
<li style="margin-top: 2px;">我在51CTO的镜像</li>
<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl02_Link" href="http://weblogs.asp.net/TerryLee/" target="_top">TerryLee @ ASP.NET</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl02_RssLink" title="Subscribe to TerryLee @ ASP.NET" href="http://weblogs.asp.net/terrylee/rss.aspx">(rss)</a></li>
<li style="margin-top: 2px;">我在ASP.NET网站</li>
<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl03_Link" href="http://space.itpub.net/12184684/" target="_top">TerryLee @ IT168</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl03_RssLink" title="Subscribe to TerryLee @ IT168" href="http://space.itpub.net/12184684/action-rss-type-">(rss)</a></li>
<li style="margin-top: 2px;">我在IT168的镜像</li>
<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl04_Link" href="http://blog.joycode.com/terrylee/" target="_top">TerryLee @ 博客堂</a> <a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl04_RssLink" title="Subscribe to TerryLee @ 博客堂" href="http://blog.joycode.com/terrylee/Rss.aspx">(rss)</a></li>
<li style="margin-top: 2px;">我在博客堂的一片天地</li>
<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl05_Link" href="http://www.dotneteye.cn/" target="_top">个人主页</a> </li>

</ul>

</div>

<div class="catList">
<h3 class="catListTitle">我的好友</h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl01_Link" href="http://chwkai.cnblogs.com/" target="_top">Aero</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl01_RssLink" title="Subscribe to Aero" href="http://chwkai.cnblogs.com/Rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl02_Link" href="http://anchky.cnblogs.com/" target="_top">anchky</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl02_RssLink" title="Subscribe to anchky" href="http://anchky.cnblogs.com/Rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl03_Link" href="http://www.cnblogs.com/anytao">Anytao</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl03_RssLink" title="Subscribe to Anytao" href="http://www.cnblogs.com/anytao/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl04_Link" href="http://www.cnblogs.com/autumoon" target="_top">Autumoon</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl04_RssLink" title="Subscribe to Autumoon" href="http://www.cnblogs.com/Autumoon/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl05_Link" href="http://www.cnblogs.com/renrenqq/" target="_top">DDL</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl05_RssLink" title="Subscribe to DDL" href="http://www.cnblogs.com/renrenqq/Rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl06_Link" href="http://dflying.cnblogs.com/" target="_top">Dflying Chen</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl06_RssLink" title="Subscribe to Dflying Chen" href="http://dflying.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl07_Link" href="http://dudu.cnblogs.com/" target="_top">Dudu</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl07_RssLink" title="Subscribe to Dudu" href="http://dudu.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl08_Link" href="http://perhaps.cnblogs.com/" target="_top">Fantasy Soft</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl08_RssLink" title="Subscribe to Fantasy Soft" href="http://perhaps.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl09_Link" href="http://idior.cnblogs.com/" target="_top">idior</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl09_RssLink" title="Subscribe to idior" href="http://idior.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl10_Link" href="http://www.cnblogs.com/jessequ" target="_top">JesseQu</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl10_RssLink" title="Subscribe to JesseQu" href="http://www.cnblogs.com/jessequ/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl11_Link" href="http://www.cnblogs.com/Jillzhang" target="_top">Jillzhang</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl11_RssLink" title="Subscribe to Jillzhang" href="http://www.cnblogs.com/jillzhang/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl12_Link" href="http://kid-li.cnblogs.com/" target="_top">kid-li</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl12_RssLink" title="Subscribe to kid-li" href="http://kid-li.cnblogs.com/Rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl13_Link" href="http://luking.cnblogs.com/" target="_top">luking</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl13_RssLink" title="Subscribe to luking" href="http://luking.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl14_Link" href="http://www.cnblogs.com/michellehu" target="_top">MichelleHu</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl14_RssLink" title="Subscribe to MichelleHu" href="http://www.cnblogs.com/michellehu/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl15_Link" href="http://blog.csdn.net/priderock" target="_top">PrideRock的专栏</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl15_RssLink" title="Subscribe to PrideRock的专栏" href="http://feeds.feedsky.com/csdn.net/PrideRock">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl16_Link" href="http://www.cnblogs.com/isuper/" target="_top">RogerTong </a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl16_RssLink" title="Subscribe to RogerTong " href="http://www.cnblogs.com/isuper/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl17_Link" href="http://www.cnblogs.com/Sunmoonfire" target="_top">Sunmoonfire</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl17_RssLink" title="Subscribe to Sunmoonfire" href="http://www.cnblogs.com/Sunmoonfire/Rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl18_Link" href="http://www.cnblogs.com/teddyma" target="_top">Teddy</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl18_RssLink" title="Subscribe to Teddy" href="http://www.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl19_Link" href="http://www.cnblogs.com/wayfarer" target="_top">wayfarer</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl19_RssLink" title="Subscribe to wayfarer" href="http://www.cnblogs.com/wayfarer/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl20_Link" href="http://hjf1223.cnblogs.com/" target="_top">阿不</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl20_RssLink" title="Subscribe to 阿不" href="http://hjf1223.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl21_Link" href="http://www.cnblogs.com/bvbook" target="_top">博文视点官方博客</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl21_RssLink" title="Subscribe to 博文视点官方博客" href="http://www.cnblogs.com/bvbook/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl22_Link" href="http://www.cnblogs.com/herohuo" target="_top">大人物中的小人物</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl22_RssLink" title="Subscribe to 大人物中的小人物" href="http://www.cnblogs.com/herohuo/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl23_Link" href="http://www.cnblogs.com/dingxue" target="_top">丁学</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl23_RssLink" title="Subscribe to 丁学" href="http://www.cnblogs.com/dingxue/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl24_Link" href="http://www.cnblogs.com/guaiguai/" target="_top">怪怪</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl24_RssLink" title="Subscribe to 怪怪" href="http://www.cnblogs.com/guaiguai/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl25_Link" href="http://www.cnblogs.com/callwangxiang" target="_top">蜡笔小巢</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl25_RssLink" title="Subscribe to 蜡笔小巢" href="http://www.cnblogs.com/callwangxiang/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl26_Link" href="http://www.cnblogs.com/waxdoll/" target="_top">蜡人张</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl26_RssLink" title="Subscribe to 蜡人张" href="http://waxdoll.cnblogs.com/Rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl27_Link" href="http://www.cnblogs.com/jeffreyzhao" target="_top">老赵</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl27_RssLink" title="Subscribe to 老赵" href="http://www.cnblogs.com/JeffreyZhao/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl28_Link" href="http://www.joygee.com/" target="_top">李茹</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl28_RssLink" title="Subscribe to 李茹" href="feed://http//www.joygee.com/feed/">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl29_Link" href="http://www.agilelabs.cn/blogs/linkin/default.aspx" target="_top">卢彦</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl29_RssLink" title="Subscribe to 卢彦" href="http://www.agilelabs.cn/blogs/linkin/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl30_Link" href="http://zhenyulu.cnblogs.com/" target="_top">吕震宇</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl30_RssLink" title="Subscribe to 吕震宇" href="http://zhenyulu.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl31_Link" href="http://www.cnblogs.com/lbq1221119" target="_top">罗炳桥</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl31_RssLink" title="Subscribe to 罗炳桥" href="http://www.cnblogs.com/lbq1221119/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl32_Link" href="http://lixianhuei.cnblogs.com/" target="_top">难得一蠢</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl32_RssLink" title="Subscribe to 难得一蠢" href="http://lixianhuei.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl33_Link" href="http://birdshome.cnblogs.com/" target="_top">鸟食轩</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl33_RssLink" title="Subscribe to 鸟食轩" href="http://birdshome.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl34_Link" href="http://bear-study-hard.cnblogs.com/" target="_top">努力学习的熊</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl34_RssLink" title="Subscribe to 努力学习的熊" href="http://bear-study-hard.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl35_Link" href="http://blog.donews.com/crabhn/" target="_top">螃蟹</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl35_RssLink" title="Subscribe to 螃蟹" href="http://blog.donews.com/crabhn/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl36_Link" href="http://crysta10203.blog.sohu.com/" target="_top">水晶心情</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl36_RssLink" title="Subscribe to 水晶心情" href="http://tb.sogou.com/rss?ch=it&amp;desc=%CB%D1%BA%FC%B2%A9%BF%CD%B6%A9%D4%C4&amp;url=http://crysta10203.blog.sohu.com/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl37_Link" href="http://xh831213.cnblogs.com/" target="_top">小寒</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl37_RssLink" title="Subscribe to 小寒" href="http://xh831213.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl38_Link" href="http://overred.cnblogs.com/" target="_top">雁儿飞飞</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl38_RssLink" title="Subscribe to 雁儿飞飞" href="http://overred.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl39_Link" href="http://www.cnblogs.com/justinyoung" target="_top">杨正祎</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl39_RssLink" title="Subscribe to 杨正祎" href="http://www.cnblogs.com/JustinYoung/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl40_Link" href="http://goodcandle.cnblogs.com/" target="_top">源码工作室</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl40_RssLink" title="Subscribe to 源码工作室" href="http://goodcandle.cnblogs.com/rss.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl41_Link" href="http://www.cnblogs.com/msdpe/" target="_top">张大磊</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl41_RssLink" title="Subscribe to 张大磊" href="http://www.cnblogs.com/msdpe/RSS.aspx">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl42_Link" href="http://www.cyworld.com.cn/qiansui" target="_top">张莹</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl43_Link" href="http://www.cnblogs.com/zhouyinhui" target="_top">周银辉</a> <a id="SingleColumn1_Categories_CatList_ctl03_LinkList_ctl43_RssLink" title="Subscribe to 周银辉" href="http://www.cnblogs.com/zhouyinhui/rss">(rss)</a></li>

</ul>

</div>



<div class="catListBlogRank">
<h3 class="catListTitle">积分与排名</h3>
<ul>
	<li class="liScore">
		积分 -	5250874
	</li><li class="liRank">
		排名 -	3
	</li>
</ul>
</div>



<div class="catListView">
<h3 class="catListTitle">阅读排行榜</h3>
	
			<ul>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/07/17/334911.html">1.&nbsp;.NET设计模式系列文章(240785)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/11/12/ASPNET_AJAX_QuickStarts.html">2.&nbsp;ASP.NET AJAX入门系列(162046)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2007/12/09/the-ultimate-jquery-plugin-list.html">3.&nbsp;强烈推荐：240多个jQuery插件(160249)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2008/03/21/Silverlight2-step-by-step-Tutorials.html">4.&nbsp;一步一步学Silverlight 2系列文章(94439)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/10/25/ASPNET_AJAX_ScriptManager.html">5.&nbsp;ASP.NET AJAX入门系列（2）：使用ScriptManager控件(88540)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl06_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/08/01/Enterprise_Library.html">6.&nbsp;Enterprise Library系列文章回顾与总结(87348)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl07_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/04/28/castl_ioc_article.html">7.&nbsp;Castle 开发系列文章(87221)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl08_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2005/12/09/293509.html">8.&nbsp;.NET设计模式（2）：单件模式（Singleton Pattern）(85295)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl09_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2005/09/28/246050.html">9.&nbsp;今天下午真郁闷……(79632)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl10_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2005/12/13/295965.html">10.&nbsp;.NET设计模式（3）：抽象工厂模式（Abstract Factory）(73903)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl11_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/10/24/ASPNET_AJAX_Quick_Starts_Overview.html">11.&nbsp;ASP.NET AJAX入门系列（1）：概述(67798)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl12_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2008/03/07/Silverlight2-step-by-step-part1.html">12.&nbsp;一步一步学Silverlight 2系列（1）：创建一个基本的Silverlight应用(49550)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl13_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/01/04/310716.html">13.&nbsp;.NET设计模式（5）：工厂方法模式（Factory Method）(47209)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl14_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/10/29/ASPNET_AJAX_UpdatePanel_Part1.html">14.&nbsp;ASP.NET AJAX入门系列（4）：使用UpdatePanel控件（一）(44878)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl15_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/04/03/365762.html">15.&nbsp;Castle ActiveRecord学习实践（1）：快速入门指南(44506)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl16_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2005/12/09/293465.html">16.&nbsp;.NET设计模式（1）：开篇(36398)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl17_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2005/10/14/254631.html">17.&nbsp;Enterprise Library Step By Step系列（一）：配置应用程序块——入门篇(36023)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl18_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2005/12/19/299878.html">18.&nbsp;.NET设计模式（4）：建造者模式（Builder Pattern）(34152)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl19_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2005/12/28/306254.html">19.&nbsp;CodeSmith开发系列资料总结(30459)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl20_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/12/01/OpenSource_Framework_And_Resource_Recommendation_Overview.html">20.&nbsp;.NET开源项目介绍及资源推荐：序(30351)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl21_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2008/03/07/Silverlight2-step-by-step-part2.html">21.&nbsp;一步一步学Silverlight 2系列（2）：基本控件(29159)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl22_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/10/27/ASPNET_AJAX_ScriptManagerProxy.html">22.&nbsp;ASP.NET AJAX入门系列（3）：使用ScriptManagerProxy控件(28846)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl23_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/09/01/atlas_series_articles.html">23.&nbsp;Atlas学习手记系列(28339)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl24_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/10/23/Observer_Pattern.html">24.&nbsp;.NET设计模式（19）：观察者模式（Observer Pattern）(28231)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl25_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/11/01/ASPNET_AJAX_UpdatePanle_Part2.html">25.&nbsp;ASP.NET AJAX入门系列（5）：使用UpdatePanel控件（二）(27899)</a>
			</li>
		
			</ul>
		
</div>

<div class="catListFeedback">
<h3 class="catListTitle">评论排行榜</h3>
	
			<ul>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2005/10/13/253667.html">1.&nbsp;如何用SQLDMO在ASP.NET页面下实现数据库的备份与恢复(395)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/07/17/334911.html">2.&nbsp;.NET设计模式系列文章(355)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2009/01/05/LINQ-and-LINQ-to-SQL.html">3.&nbsp;不得不为LINQ说几句话，驳“LINQ已死”论(318)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2008/03/21/Silverlight2-step-by-step-Tutorials.html">4.&nbsp;一步一步学Silverlight 2系列文章(246)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/01/04/310968.html">5.&nbsp;CodeSmith3.0开发资料下载(233)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl06_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2005/12/13/295965.html">6.&nbsp;.NET设计模式（3）：抽象工厂模式（Abstract Factory）(216)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl07_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/05/23/406688.html">7.&nbsp;新版设计模式手册[C#]下载(216)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl08_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/10/25/ASPNET_AJAX_ScriptManager.html">8.&nbsp;ASP.NET AJAX入门系列（2）：使用ScriptManager控件(179)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl09_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2007/12/09/the-ultimate-jquery-plugin-list.html">9.&nbsp;强烈推荐：240多个jQuery插件(168)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl10_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/11/12/ASPNET_AJAX_QuickStarts.html">10.&nbsp;ASP.NET AJAX入门系列(168)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl11_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/04/03/365762.html">11.&nbsp;Castle ActiveRecord学习实践（1）：快速入门指南(166)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl12_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/04/28/castl_ioc_article.html">12.&nbsp;Castle 开发系列文章(164)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl13_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/10/23/Observer_Pattern.html">13.&nbsp;.NET设计模式（19）：观察者模式（Observer Pattern）(162)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl14_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/08/01/Enterprise_Library.html">14.&nbsp;Enterprise Library系列文章回顾与总结(158)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl15_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/01/04/310716.html">15.&nbsp;.NET设计模式（5）：工厂方法模式（Factory Method）(158)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl16_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2005/12/09/293509.html">16.&nbsp;.NET设计模式（2）：单件模式（Singleton Pattern）(153)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl17_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/03/21/354972.html">17.&nbsp;天津.NET俱乐部成立了！(146)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl18_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2006/10/29/ASPNET_AJAX_UpdatePanel_Part1.html">18.&nbsp;ASP.NET AJAX入门系列（4）：使用UpdatePanel控件（一）(133)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl19_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2007/12/04/TemplateEngine-Smart-Code-Preview.html">19.&nbsp;基于模板引擎的代码生成器Smart Code预览(129)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl20_Hyperlink1" href="http://www.cnblogs.com/Terrylee/archive/2008/03/07/Silverlight2-step-by-step-part1.html">20.&nbsp;一步一步学Silverlight 2系列（1）：创建一个基本的Silverlight应用(125)</a>
			</li>
		
			</ul>
		
</div>

			</div>
			
		</div><!--end: sideBarMain -->
	</div><!--end: sideBar 侧边栏容器 -->
	<div class="clear"></div>
	</div><!--end: main -->
	<div class="clear"></div>
	<div id="footer">
		
<!--done-->
Copyright ©2010 TerryLee
	</div><!--end: footer -->
</div><!--end: home 自定义的最大容器 -->
    </form>
	
	
      
    
    
    
</body>
</html>
